chainetv_web/Dockerfile

24 lines
762 B
Docker
Raw Permalink Normal View History

2022-05-10 11:41:33 +00:00
FROM python:3.9-alpine as Build
2022-05-10 08:10:17 +00:00
COPY backend/ /pkg/backend
RUN apk -U --no-progress upgrade && \
apk --no-progress add gcc musl-dev && \
pip install -r /pkg/backend/requirements.txt && \
mv "/usr/local" "/pkg/usr" && \
adduser -S -D -H -h /var/lib/chaineTV -s /sbin/nologin -G users -g chaineTV chaineTV && \
2022-05-15 18:56:01 +00:00
chown chaineTV /pkg/backend -R && \
2022-05-10 08:10:17 +00:00
install -d -m755 "/pkg/etc" && \
install -m644 "/etc/passwd" "/pkg/etc/passwd" &&\
install -m644 "/etc/group" "/pkg/etc/group" &&\
install -m640 -gshadow "/etc/shadow" "/pkg/etc/shadow"
FROM alpine
COPY --from=Build /pkg /
2022-05-10 11:41:33 +00:00
RUN apk -U --no-progress upgrade && \
apk --no-progress add py3-gunicorn
2022-05-10 08:10:17 +00:00
USER chaineTV
EXPOSE 5000
WORKDIR /backend
2022-05-19 17:55:50 +00:00
CMD /usr/bin/gunicorn --workers=2 -b :5000 run:app
2022-05-10 08:10:17 +00:00