forked from BITNP/interview_django
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
20 lines (18 loc) · 783 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM python:3.12-slim
COPY . /usr/src/app
WORKDIR /usr/src/app
COPY deploy/sources.list /etc/apt/sources.list
RUN rm /etc/apt/sources.list.d/debian.sources && \
apt-get update && \
apt-get install -y nginx tini && \
rm -rf /var/lib/apt/lists/* && \
sed -i 's/worker_processes auto/worker_processes 4/g' /etc/nginx/nginx.conf && \
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install -r requirements.txt --no-cache-dir && \
python3 manage.py collectstatic --noinput && \
mkdir -p /usr/src/app/logs/nginx && \
mkdir -p /usr/src/app/logs/gunicorn
COPY deploy/nginx-app.conf /etc/nginx/sites-available/default
EXPOSE 80
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD [ "/bin/bash", "/usr/src/app/deploy/entrypoint.sh" ]