add docker file

This commit is contained in:
vincent 2022-05-10 10:10:17 +02:00
parent d62b16df39
commit fe66948742
2 changed files with 27 additions and 0 deletions

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM python:3.8-alpine as Build
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 && \
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 /
RUN apk --no-progress add py3-gunicorn
USER chaineTV
EXPOSE 5000
WORKDIR /backend
CMD /usr/bin/gunicorn --workers=4 -b :5000 run:app

6
Makefile Normal file
View File

@ -0,0 +1,6 @@
DOCKER_ORGANIZATION := ducampsv
DOCKER_IMAGE := chainetv
DOCKER_TAG ?= base
docker-build:
docker buildx build -t $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE):$(DOCKER_TAG) .