From 9a889f61c7b83834a37bf44fe2d0308fb562f3ba Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 30 Jul 2019 00:48:37 +0200 Subject: [docker] Download IHM from Pypy or reference git repo; This creates two modes to run the Docker image: - either in non-NIGHTLY mode, the latest version will be installed from pypy. - or in Nightly mode, it will clone the repository and update it every time the instance is restarted. It also updates Python to 3.7, for additional goodness. --- Dockerfile | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 8f5e41e..5645a62 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,7 @@ -FROM python:3.6-alpine +FROM python:3.7-alpine -RUN apk update && apk add gcc libc-dev libffi-dev openssl-dev &&\ - mkdir /ihatemoney &&\ - mkdir -p /etc/ihatemoney &&\ - pip install --no-cache-dir gunicorn pymysql - -COPY . /ihatemoney -ARG INSTALL_FROM_PYPI="False" -RUN if [ "$INSTALL_FROM_PYPI" = True ]; then\ - pip install --no-cache-dir ihatemoney ; else\ - pip install --no-cache-dir -e /ihatemoney ; \ - fi - -ENV DEBUG="False" \ +ENV NIGHTLY="" \ + DEBUG="False" \ SQLALCHEMY_DATABASE_URI="sqlite:////database/ihatemoney.db" \ SQLALCHEMY_TRACK_MODIFICATIONS="False" \ SECRET_KEY="tralala" \ @@ -21,13 +10,19 @@ ENV DEBUG="False" \ MAIL_PORT=25 \ MAIL_USE_TLS=False \ MAIL_USE_SSL=False \ - MAIL_USERNAME=None \ - MAIL_PASSWORD=None \ + MAIL_USERNAME= \ + MAIL_PASSWORD= \ ACTIVATE_DEMO_PROJECT="True" \ ADMIN_PASSWORD="" \ ALLOW_PUBLIC_PROJECT_CREATION="True" \ ACTIVATE_ADMIN_DASHBOARD="False" +RUN apk update && apk add git gcc libc-dev libffi-dev openssl-dev wget &&\ + mkdir -p /etc/ihatemoney &&\ + pip install --no-cache-dir gunicorn pymysql; + +COPY ./conf/entrypoint.sh /entrypoint.sh + VOLUME /database EXPOSE 8000 -ENTRYPOINT ["/ihatemoney/conf/confandrun.sh"] +ENTRYPOINT ["/entrypoint.sh"] -- cgit v1.1