Dockerize the Application.

This commit is contained in:
Patrick Jentsch
2019-09-06 11:38:35 +02:00
parent 1044674074
commit b9a8c63aee
4 changed files with 46 additions and 59 deletions

View File

@ -1,6 +1,12 @@
FROM python:3.6-alpine
EXPOSE 5000
ENV FLASK_APP=opaque.py
RUN apk add \
build-base \
postgresql-dev
@ -8,28 +14,15 @@ RUN apk add \
RUN adduser -D opaque
USER opaque
WORKDIR /home/opaque
COPY app app
COPY migrations migrations
COPY config.py opaque.py ./
COPY requirements.txt requirements.txt
ENV FLASK_APP=opaque.py
copy migrations migrations
COPY config.py opaque.py requirements.txt ./
RUN python -m venv venv && \
venv/bin/pip install -r requirements.txt
COPY docker-entrypoint.sh /usr/local/bin/
EXPOSE 5000
ENTRYPOINT ["docker-entrypoint.sh"]