-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (31 loc) · 869 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.9-alpine3.13
LABEL maintainer="lam0612"
ENV PYTHONUNBUFFERED 1
COPY ./requirements.txt /tmp/requirements.txt
COPY ./requirements.dev.txt /tmp/requirements.dev.txt
COPY ./app /app
WORKDIR /app
EXPOSE 8000
ADD requirements.txt ./tmp/requirements.txt
ARG DEV=false
RUN python -m venv /py && \
/py/bin/pip install --upgrade pip &&\
/py/bin/pip install -r /tmp/requirements.txt &&\
if [ ${DEV}=true ]; \
then /py/bin/pip install -r /tmp/requirements.dev.txt;\
fi && \
# /py/bin/pip install linux-headers &&\
rm -rf /tmp/ && \
# adduser \
# --disabled-password \
# --gecos "" \
# --home /app \
# django-user
adduser \
--disabled-password \
--no-create-home \
django-user
RUN chown django-user -R /app
RUN chmod +x /app
ENV PATH="/py/bin:${PATH}"
USER django-user