-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
34 lines (28 loc) · 822 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM python:3.12.3-alpine3.19
LABEL maintainer="yoon"
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY ./zbackend/requirements.txt /tmp/requirements.txt
COPY ./zbackend/requirements.dev.txt /tmp/requirements.dev.txt
COPY ./scripts /scripts
COPY ./zbackend /app
WORKDIR /app
EXPOSE 8000
ARG DEV=false
RUN python -m venv /py && \
/py/bin/pip install --upgrade pip && \
/py/bin/pip install -r /tmp/requirements.txt && \
rm -rf /tmp && \
apk del .tmp-build-deps && \
adduser \
--disabled-password \
--no-create-home \
django-user && \
mkdir -p /vol/web/media && \
mkdir -p /vol/web/static && \
chown -R django-user:django-user /vol && \
chmod -R 755 /vol && \
chmod -R +x /scripts
ENV PATH="/scripts:/py/bin:$PATH"
USER django-user
CMD ["run.sh"]