Commit 5012effd authored by BERJON Matthieu's avatar BERJON Matthieu

Update docker deployement

I updated the Dockerfile as well as the nginx config and the django
application deployement. There are still issues such as the `/vol/nginx`
doesn't exist for some unknown reasons making nginx refusing to launch.
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <matthieu.berjon@inria.fr>
parent feca6657
FROM allgo/base-debian FROM debian:stretch
# install system packages # install system packages
RUN apt-getq install mariadb-client libmariadb-client-lgpl-dev-compat \ RUN apt-get update && apt-get install -y \
redis-server curl imagemagick git ca-certificates \ mysql-server default-libmysqlclient-dev \
gcc g++ make libc6-dev file libffi-dev libgdbm-dev libgmp-dev \ nginx-light zip \
libncurses5-dev libncursesw5-dev libreadline6-dev libssl-dev \ python3 python3-dev python3-pip python3-django python3-mysqldb python-mysqldb \
libyaml-dev openssl procps systemtap-sdt-dev zlib1g-dev \ python3-django-environ
supervisor nginx-light zip \
python3 python3-pip python3-django
COPY . /opt/allgo COPY . /opt/allgo
COPY init /dk/container_init COPY init /dk/container_init
RUN sh /opt/allgo/setup/dk/container_init RUN bash /opt/allgo/setup/dk/container_init
WORKDIR /opt/allgo WORKDIR /opt/allgo
LABEL dk.migrate_always=1 LABEL dk.migrate_always=1
# ENTRYPOINT /bin/bash /opt/allgo/setup/dk/run-allgo
...@@ -4,6 +4,8 @@ set -e -x ...@@ -4,6 +4,8 @@ set -e -x
# mkdir /vol && chown allgo: /vol # mkdir /vol && chown allgo: /vol
SETUP=/opt/allgo/setup/dk SETUP=/opt/allgo/setup/dk
#pip3 install --force-reinstall mysqlclient django-environ
mkdir -p \ mkdir -p \
/vol/rw/datastore \ /vol/rw/datastore \
/vol/rw/app \ /vol/rw/app \
...@@ -14,10 +16,10 @@ mkdir -p \ ...@@ -14,10 +16,10 @@ mkdir -p \
/vol/log/supervisor \ /vol/log/supervisor \
/vol/log/gunicorn \ /vol/log/gunicorn \
/vol/cache/redis \ /vol/cache/redis \
/vol/cache/nginx /vol/cache/nginx
# scripts # Apply patch to nginx.conf to update the volume paths
ln -s "$SETUP/run-allgo" /usr/local/bin patch /etc/nginx/nginx.conf < $SETUP/nginx.patch
# supervisord config # supervisord config
# rm /etc/supervisor/supervisord.conf # rm /etc/supervisor/supervisord.conf
...@@ -25,11 +27,4 @@ ln -s "$SETUP/run-allgo" /usr/local/bin ...@@ -25,11 +27,4 @@ ln -s "$SETUP/run-allgo" /usr/local/bin
# nginx config # nginx config
rm /etc/nginx/sites-enabled/default rm /etc/nginx/sites-enabled/default
ln -s "/opt/allgo/setup/dk/nginx.conf" /etc/nginx/sites-enabled/allgo ln -s "/opt/allgo/setup/dk/allgo.conf" /etc/nginx/sites-enabled/allgo
# exec nginx -t && exec nginx -g 'daemon off;'
# nginx -t
# nginx -g 'daemon off;' &
# exec python3 /opt/allgo/manage.py runserver 4000&
# exec supervisord -n
exec run-allgo
41,42c41,42
< access_log /var/log/nginx/access.log;
< error_log /var/log/nginx/error.log;
---
> access_log /vol/log/nginx/access.log;
> error_log /vol/log/nginx/error.log;
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
set -e set -e
# exec nginx -g 'daemon off;' # dump the database and execute the migration
while ! mysql -u allgo -h dev-mysql --password=allgo -e ";"
do
sleep 2
done
/bin/bash /opt/allgo/tools/migration.sh -e allgo allgo dev-mysql allgo
/bin/bash /opt/allgo/tools/migration.sh -d allgo allgo dev-mysql allgo
/bin/bash /opt/allgo/tools/migration.sh -m allgo allgo dev-mysql allgo
# service nginx start
python3 /opt/allgo/manage.py runserver 4000 & python3 /opt/allgo/manage.py runserver 4000 &
service nginx start exec nginx -g 'daemon off;'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment