From 29a9d330c21062f3bf19dac1daa6d7179452969e Mon Sep 17 00:00:00 2001 From: Andrey Arapov Date: Tue, 27 Jun 2017 23:27:00 +0200 Subject: [PATCH] updates --- Dockerfile | 23 ++++++++++++----------- README.md | 2 +- launch | 8 +++++--- seeds/already_initialized.tmpl | 2 +- seeds/circus.ini.tmpl | 4 ++-- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 957b196..8fbac41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:jessie +FROM debian:stretch MAINTAINER "Andrey Arapov " EXPOSE 80 @@ -6,14 +6,14 @@ EXPOSE 80 ENV DEBIAN_FRONTEND noninteractive # OS & Python env deps for taiga-back -RUN apt-get update -qq \ +RUN apt-get update \ && apt-get install -y -- build-essential binutils-doc autoconf flex \ bison libjpeg-dev libfreetype6-dev zlib1g-dev libzmq3-dev \ libgdbm-dev libncurses5-dev automake libtool libffi-dev curl git \ - tmux gettext python3.4 python3.4-dev python3-pip libxml2-dev \ - libxslt-dev libpq-dev virtualenv \ - nginx \ - && rm -rf -- /var/lib/apt/lists/* + tmux gettext python3 python3-dev python3-pip libxml2-dev \ + libxslt-dev virtualenvwrapper libssl1.0-dev \ + nginx && \ + rm -rf -- /var/lib/apt/lists/* RUN pip3 install circus gunicorn @@ -29,12 +29,15 @@ RUN mkdir -p $DATA $DATA/media $DATA/static $DATA/logs /var/log/taiga \ WORKDIR $DATA +RUN ln -svf /bin/bash /bin/sh + # Install taiga-back RUN git clone -b stable https://github.com/taigaio/taiga-back.git taiga-back \ - && virtualenv -p /usr/bin/python3.4 venvtaiga \ - && . venvtaiga/bin/activate \ + && source /usr/share/virtualenvwrapper/virtualenvwrapper.sh \ + && mkvirtualenv -p /usr/bin/python3.5 venvtaiga \ + && workon venvtaiga \ && cd taiga-back \ - && pip3 install -U setuptools \ + && pip3 install --upgrade setuptools \ && pip3 install -r requirements.txt \ && deactivate @@ -42,8 +45,6 @@ RUN git clone -b stable https://github.com/taigaio/taiga-back.git taiga-back \ RUN git clone -b stable https://github.com/taigaio/taiga-front-dist.git taiga-front-dist COPY robots.txt taiga-front-dist/dist/robots.txt -USER $USER - USER root # Cleanups diff --git a/README.md b/README.md index 0e854b0..e6f5166 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ This file defines individual settings for Taiga. **taiga.env** ``` GUNICORN_WORKERS=1 -SITE_URI=http://taiga +SITE_URI=http://taiga.mydomain.com PUBLIC_REGISTER=true ADMIN_EMAIL=admin@mydomain.com NOREPLY_EMAIL=no-reply@mydomain.com diff --git a/launch b/launch index 134e8e1..220cccc 100755 --- a/launch +++ b/launch @@ -45,8 +45,7 @@ chmod +x /already_initialized unset DJANGO_SECRET_KEY TAIGA_DB_PASSWORD # Make sure the dynamic data is writable by the circus/gunicorn -chown -Rh $USER:$GROUP $DATA/media $DATA/taiga-back/taiga/locale $DATA/logs \ - $DATA/static +chown -Rh $USER:$GROUP $DATA/media $DATA/taiga-back/taiga/locale $DATA/logs # Make sure the PostgreSQL database is up and ready while ! ping -c 1 -W 1 $TAIGA_DB_HOST >/dev/null 2>&1; do @@ -63,9 +62,12 @@ done # running before it will be seeded/updated /already_initialized +# TODO: in case if /already_initialized fails, the bad things will happen, like the default: admin:123123 ... need to make this more robust. + # Upgrade DB schemas, etc... # This is important when Taiga's codebase gets updated -su -s /bin/sh $USER -c '. $DATA/venvtaiga/bin/activate +su -s /bin/bash $USER -c 'source /usr/share/virtualenvwrapper/virtualenvwrapper.sh +workon venvtaiga cd $DATA/taiga-back python manage.py migrate --noinput /already_initialized || ( python manage.py loaddata initial_user \ diff --git a/seeds/already_initialized.tmpl b/seeds/already_initialized.tmpl index 020ed79..8e82d8b 100644 --- a/seeds/already_initialized.tmpl +++ b/seeds/already_initialized.tmpl @@ -1,4 +1,4 @@ -#!$DATA/venvtaiga/bin/python +#!$HOME/.virtualenvs/venvtaiga/bin/python # A simple script that checks whether the 'admin' user has been created. # It returns 0 on success and 1 on failure. # Based on this the /launch script will decide whether to create the default diff --git a/seeds/circus.ini.tmpl b/seeds/circus.ini.tmpl index f08cb51..493452b 100644 --- a/seeds/circus.ini.tmpl +++ b/seeds/circus.ini.tmpl @@ -22,10 +22,10 @@ stderr_stream.max_bytes = 10485760 stderr_stream.backup_count = 4 [env:taiga] -PATH = ${DATA}/venvtaiga/bin:${ESC}PATH +PATH = ${HOME}/.virtualenvs/venvtaiga/bin:${ESC}PATH TERM=rxvt-256color SHELL=/bin/bash USER=taiga LANG=en_US.UTF-8 HOME=${DATA} -PYTHONPATH=${DATA}/venvtaiga/lib/python3.4/site-packages +PYTHONPATH=${HOME}/.virtualenvs/venvtaiga/lib/python3.5/site-packages