aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2019-03-27 13:45:47 +0000
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2019-03-27 13:51:11 +0000
commitc4887530f8ececad37de5f03b90366b6492c7e21 (patch)
tree14eb77a0853c1813a0fc96faeb898b0e7cd3d435 /Dockerfile
parentAdd dataset overview for admin (diff)
downloadAnnotateChange-c4887530f8ececad37de5f03b90366b6492c7e21.tar.gz
AnnotateChange-c4887530f8ececad37de5f03b90366b6492c7e21.zip
add initial deployment files
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..6b34919
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,37 @@
+FROM python:3.6-alpine
+
+RUN adduser -D annotatechange
+
+WORKDIR /home/annotatechange
+
+# See: https://stackoverflow.com/q/53835198/
+ARG YOUR_ENV
+ENV YOUR_ENV=${YOUR_ENV} \
+ PYTHONFAULTHANDLER=1 \
+ PYTHONUNBUFFERED=1\
+ PYTHONHASHSEED=random \
+ PIP_NO_CACHE_DIR=off \
+ PIP_DIABLE_PIP_VERSION_CHECK=on \
+ PIP_DEFAULT_TIMEOUT=100 \
+ POETRY_VERSION=0.12.11
+
+RUN pip install "poetry==$POETRY_VERSION"
+
+COPY poetry.lock pyproject.toml /home/annotatechange
+
+RUN poetry config settings.virtualenvs.create false \
+ && poetry install $(test "$YOUR_ENV" == production && echo "--no-dev") \
+ --no-interaction --no-ansi
+
+COPY app app
+COPY migrations migrations
+COPY annotate_change.py config.py boot.sh ./
+RUN chmod +x boot.sh
+
+ENV FLASK_APP annotate_change.py
+
+RUN chown -R annotate_change:annotate_change ./
+USER annotate_change
+
+EXPOSE 5000
+ENTRYPOINT ["./boot.sh"]