端口更新到18000,提升访问速度,使用清华镜像,安装优化!
This commit is contained in:
parent
578f5d9a3d
commit
39edb33815
19
Dockerfile
19
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"]
|
||||
#CMD ["sh", "start.sh"]
|
||||
|
||||
@ -5,7 +5,7 @@ services:
|
||||
container_name: backend
|
||||
command: sh start.sh
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "18000:18000"
|
||||
volumes:
|
||||
- ./db.sqlite3:/app/db.sqlite3
|
||||
logging:
|
||||
|
||||
2
start.sh
2
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
|
||||
Loading…
x
Reference in New Issue
Block a user