-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
31 lines (20 loc) · 641 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
FROM python:3.9-alpine3.14
ENV PYTHONUNBUFFERED True
ENV APP_HOME /app
ENV USER web-user
RUN addgroup -S -g 1000 $USER && adduser -S -G $USER -u 1000 $USER
WORKDIR $APP_HOME
COPY --chown=$USER requirements.txt $APP_HOME/
RUN apk add --no-cache \
libpq \
&& apk add --virtual .build-deps \
build-base python3-dev postgresql-dev \
&& pip install --no-cache-dir --ignore-installed six \
-r requirements.txt \
&& rm -rf /root/.cache/ \
&& chown -R $USER:$USER $APP_HOME \
&& apk del .build-deps
COPY --chown=$USER:$USER . $APP_HOME/
USER $USER
EXPOSE 8080
CMD ["python3","/app/main.py"]