From cc013560d95e8ebfafd3638b1b123f5a9eef143e Mon Sep 17 00:00:00 2001 From: Pierre Jaury Date: Sat, 25 Jun 2016 14:11:34 +0200 Subject: [PATCH] Perform automatic database migration --- admin/Dockerfile | 5 +++-- admin/start.sh | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100755 admin/start.sh diff --git a/admin/Dockerfile b/admin/Dockerfile index 6193aa18..502df9b7 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -4,9 +4,10 @@ RUN mkdir -p /app WORKDIR /app COPY freeposte ./freeposte -COPY initdb.py . +COPY manage.py . COPY requirements.txt . +COPY start.sh /start.sh RUN pip install -r requirements.txt -CMD gunicorn -w 4 -b 0.0.0.0:80 --access-logfile - --error-logfile - freeposte:app +CMD ["/start.sh"] diff --git a/admin/start.sh b/admin/start.sh new file mode 100755 index 00000000..58cc1f5a --- /dev/null +++ b/admin/start.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +python manage.py db upgrade +gunicorn -w 4 -b 0.0.0.0:80 --access-logfile - --error-logfile - freeposte:app