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
RUN apt-getq install mariadb-client libmariadb-client-lgpl-dev-compat \
redis-server curl imagemagick git ca-certificates \
gcc g++ make libc6-dev file libffi-dev libgdbm-dev libgmp-dev \
libncurses5-dev libncursesw5-dev libreadline6-dev libssl-dev \
libyaml-dev openssl procps systemtap-sdt-dev zlib1g-dev \
supervisor nginx-light zip \
python3 python3-pip python3-django
RUN apt-get update && apt-get install -y \
mysql-server default-libmysqlclient-dev \
nginx-light zip \
python3 python3-dev python3-pip python3-django python3-mysqldb python-mysqldb \
python3-django-environ
COPY . /opt/allgo
COPY init /dk/container_init
RUN sh /opt/allgo/setup/dk/container_init
RUN bash /opt/allgo/setup/dk/container_init
WORKDIR /opt/allgo
LABEL dk.migrate_always=1
# ENTRYPOINT /bin/bash /opt/allgo/setup/dk/run-allgo
......@@ -4,6 +4,8 @@ set -e -x
# mkdir /vol && chown allgo: /vol
SETUP=/opt/allgo/setup/dk
#pip3 install --force-reinstall mysqlclient django-environ
mkdir -p \
/vol/rw/datastore \
/vol/rw/app \
......@@ -16,8 +18,8 @@ mkdir -p \
/vol/cache/redis \
/vol/cache/nginx
# scripts
ln -s "$SETUP/run-allgo" /usr/local/bin
# Apply patch to nginx.conf to update the volume paths
patch /etc/nginx/nginx.conf < $SETUP/nginx.patch
# supervisord config
# rm /etc/supervisor/supervisord.conf
......@@ -25,11 +27,4 @@ ln -s "$SETUP/run-allgo" /usr/local/bin
# nginx config
rm /etc/nginx/sites-enabled/default
ln -s "/opt/allgo/setup/dk/nginx.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
ln -s "/opt/allgo/setup/dk/allgo.conf" /etc/nginx/sites-enabled/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 @@
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 &
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