diff --git a/Dockerfile b/Dockerfile index a73414b..0072db8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,7 @@ ENV DEBIAN_FRONTEND noninteractive # Version of Nginx to install ENV NGINX_VERSION 1.9.7-1~jessie -RUN apt-key adv \ - --keyserver hkp://pgp.mit.edu:80 \ - --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 +RUN curl -O https://nginx.org/keys/nginx_signing.key && apt-key add ./nginx_signing.key RUN echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list @@ -52,14 +50,23 @@ ENV LANG C RUN pip install --no-cache-dir -r requirements.txt -RUN echo "LANG=en_US.UTF-8" > /etc/default/locale -RUN echo "LC_TYPE=en_US.UTF-8" > /etc/default/locale -RUN echo "LC_MESSAGES=POSIX" >> /etc/default/locale -RUN echo "LANGUAGE=en" >> /etc/default/locale + + + +#RUN echo "LANG=en_US.UTF-8" >> /etc/default/locale +#RUN echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale +#RUN echo "LC_TYPE=en_US.UTF-8" >> /etc/default/locale +#RUN echo "LC_MESSAGES=POSIX" >> /etc/default/locale +#RUN echo "LANGUAGE=en" >> /etc/default/locale + + ENV LANG en_US.UTF-8 ENV LC_TYPE en_US.UTF-8 + +RUN locale-gen en_US.UTF-8 && locale -a + ENV TAIGA_SSL False ENV TAIGA_ENABLE_EMAIL False ENV TAIGA_HOSTNAME localhost @@ -67,7 +74,7 @@ ENV TAIGA_SECRET_KEY "!!!REPLACE-ME-j1598u1J^U*(y251u98u51u5981urf98u2o5uvoiiuzh RUN python manage.py collectstatic --noinput -RUN locale -a + # forward request and error logs to docker log collector RUN ln -sf /dev/stdout /var/log/nginx/access.log @@ -80,4 +87,4 @@ VOLUME /usr/src/taiga-back/media COPY checkdb.py /checkdb.py COPY docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] +CMD ["gunicorn", "-w 3", "-t 60", "--pythonpath=.", "-b 127.0.0.1:8000", "taiga.wsgi"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 1224f31..08ae3d3 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -14,20 +14,23 @@ if [ -z "$TAIGA_SKIP_DB_CHECK" ]; then if [ $DB_CHECK_STATUS -eq 1 ]; then echo "Failed to connect to database server or database does not exist." exit 1 - elif [ $DB_CHECK_STATUS -eq 2 ]; then + fi + + # Database migration check should be done in all startup in case of backend upgrade + echo "Check for database migration" + python manage.py migrate --noinput + + if [ $DB_CHECK_STATUS -eq 2 ]; then echo "Configuring initial database" - python manage.py migrate --noinput python manage.py loaddata initial_user python manage.py loaddata initial_project_templates python manage.py loaddata initial_role - python manage.py compilemessages fi fi -# Look for static folder, if it does not exist, then generate it -if [ ! -d "/usr/src/taiga-back/static" ]; then - python manage.py collectstatic --noinput -fi +# In case of frontend upgrade, locales and statics should be regenerated +python manage.py compilemessages +python manage.py collectstatic --noinput # Automatically replace "TAIGA_HOSTNAME" with the environment variable sed -i "s/TAIGA_HOSTNAME/$TAIGA_HOSTNAME/g" /taiga/conf.json @@ -59,5 +62,5 @@ fi # nginx -g "daemon off;" service nginx start -# Start Taiga backend Django server +# Start gunicorn server exec "$@" diff --git a/taiga-back b/taiga-back index d1dd363..d0ec0f9 160000 --- a/taiga-back +++ b/taiga-back @@ -1 +1 @@ -Subproject commit d1dd3631f98ad43aef37607b6d698faad861eef5 +Subproject commit d0ec0f9074f4da322fbd759a42ea0aeb6b8361d5 diff --git a/taiga-front-dist b/taiga-front-dist index 93bbd82..4eaa36e 160000 --- a/taiga-front-dist +++ b/taiga-front-dist @@ -1 +1 @@ -Subproject commit 93bbd82a983d3f7f694bfe3d460221d6ae6701ba +Subproject commit 4eaa36e5e9dd12e610a6a8217c0fd0b99f75edab