diff --git a/Dockerfile b/Dockerfile index ae49977..1a858ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,22 @@ FROM python:3.12-slim -ENV PYTHONUNBUFFERED 1 +ENV PYTHONUNBUFFERED=1 ENV TZ=Asia/Shanghai +RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ + && sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ + && apt-get update \ + && apt-get install -y procps net-tools apt-utils \ + && ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \ + && echo ${TZ} > /etc/timezone \ + && pip install pipenv -i https://pypi.tuna.tsinghua.edu.cn/simple/ + WORKDIR /app COPY . /app -RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list - -RUN apt-get update \ - && apt-get install -y procps net-tools apt-utils \ - && ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone \ - && pip install pipenv -i https://pypi.tuna.tsinghua.edu.cn/simple/ - RUN pipenv sync && pipenv install --dev RUN chmod +x /app/start.sh -CMD ["sh", "start.sh"] \ No newline at end of file +#CMD ["sh", "start.sh"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 171cd74..03d6879 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,7 +5,7 @@ services: container_name: backend command: sh start.sh ports: - - "8000:8000" + - "18000:18000" volumes: - ./db.sqlite3:/app/db.sqlite3 logging: diff --git a/start.sh b/start.sh index 741da82..70f2227 100644 --- a/start.sh +++ b/start.sh @@ -20,5 +20,5 @@ else pipenv run python manage.py migrate export DJANGO_SUPERUSER_PASSWORD=Eapil!@345 pipenv run python manage.py createsuperuser --noinput --username eapil --email eapil@localhost.com - pipenv run python manage.py runserver 0.0.0.0:8000 + pipenv run python manage.py runserver 0.0.0.0:18000 fi \ No newline at end of file