-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (21 loc) · 740 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
FROM python:3.9-alpine3.13
LABEL maintainer="jjbeekman"
ENV PYTHONUNBUFFERED 1
ARG DEV=false
EXPOSE 8000
ENV PATH="/py/bin:$PATH"
COPY ./tox.ini tox.ini
COPY ./requirements.txt /tmp/requirements.txt
COPY ./requirements.dev.txt /tmp/requirements.dev.txt
RUN pip install --upgrade pip && \
apk add --update --no-cache postgresql-client && \
apk add --update --no-cache --virtual .tmp-build-deps \
build-base postgresql-dev musl-dev && \
pip install -r /tmp/requirements.txt && \
if [ $DEV = "true" ]; then pip install -r /tmp/requirements.dev.txt; fi &&\
rm -rf /tmp && \
apk del .tmp-build-deps && \
adduser --disabled-password --no-create-home django-user
COPY app /app
WORKDIR /app
USER django-user