Johannes Zellner vor 9 Jahren
Ursprung
Commit
9b436f718b
5 geänderte Dateien mit 58 neuen und 36 gelöschten Zeilen
  1. 2 1
      CloudronManifest.json
  2. 13 7
      Dockerfile
  3. 5 6
      circus.ini
  4. 18 12
      local.py
  5. 20 10
      start.sh

+ 2 - 1
CloudronManifest.json

@@ -8,7 +8,8 @@
   "healthCheckPath": "/",
   "httpPort": 8000,
   "addons": {
-    "localstorage": {}
+    "localstorage": {},
+    "postgresql": {}
   },
   "minBoxVersion": "0.0.1",
   "manifestVersion": 1,

+ 13 - 7
Dockerfile

@@ -8,19 +8,26 @@ RUN apt-get install -y build-essential binutils-doc autoconf flex bison libjpeg-
 RUN apt-get install -y libfreetype6-dev zlib1g-dev libzmq3-dev libgdbm-dev libncurses5-dev
 RUN apt-get install -y automake libtool libffi-dev curl git tmux gettext
 
-RUN apt-get install -y python3 python3-pip python-dev python3-dev python-pip virtualenvwrapper
+RUN apt-get install -y python3 python3-pip python-dev python3-dev virtualenvwrapper
 RUN apt-get install -y libxml2-dev libxslt-dev
 
+RUN apt-get install -y postgresql-9.4 postgresql-contrib-9.4 postgresql-server-dev-9.4
+
 RUN apt-get install -y nginx
 
-## backend
 WORKDIR /app/code
+RUN virtualenv -p /usr/bin/python3.4 taiga
+ENV PATH /app/code/taga/bin:$PATH
+
+RUN easy_install pip
+
+## circus process manager
+RUN pip install circus
+
+## backend
 RUN git clone https://github.com/taigaio/taiga-back.git taiga-back
 WORKDIR /app/code/taiga-back
 RUN git checkout stable
-# RUN mkvirtualenv -p /usr/bin/python3.4 taiga
-RUN apt-get install -y postgresql-9.4 postgresql-contrib-9.4
-RUN apt-get install -y postgresql-server-dev-9.4
 RUN pip install -r requirements.txt
 
 ## frontend
@@ -29,8 +36,7 @@ RUN git clone https://github.com/taigaio/taiga-front-dist.git taiga-front-dist
 WORKDIR /app/code/taiga-front-dist
 RUN git checkout stable
 
-## circus process manager
-RUN pip2 install circus
+WORKDIR /app/code
 
 ADD circus.ini /app/code/circus.ini
 ADD circus.conf /etc/init/circus.conf

+ 5 - 6
circus.ini

@@ -9,8 +9,8 @@ statsd = true
 [watcher:taiga]
 working_dir = /app/code/taiga-back
 cmd = gunicorn
-args = -w 3 -t 60 --pythonpath=. -b 127.0.0.1:8001 taiga.wsgi
-uid = taiga
+args = -w 1 -t 60 --pythonpath=. -b 127.0.0.1:8001 taiga.wsgi
+uid = root
 numprocesses = 1
 autostart = true
 send_hup = true
@@ -24,11 +24,10 @@ stderr_stream.max_bytes = 10485760
 stderr_stream.backup_count = 4
 
 [env:taiga]
-PATH = /app/code/.virtualenvs/taiga/bin:$PATH
+PATH=/app/code/taiga/bin:$PATH
 TERM=rxvt-256color
 SHELL=/bin/bash
-USER=taiga
+USER=root
 LANG=en_US.UTF-8
 HOME=/app/code
-PYTHONPATH=/app/code/.virtualenvs/taiga/lib/python3.4/site-packages
-
+PYTHONPATH=/app/code/taiga/lib/python3.4/site-packages

+ 18 - 12
local.py

@@ -19,15 +19,21 @@ SERVER_EMAIL = DEFAULT_FROM_EMAIL
 
 # Uncomment and populate with proper connection parameters
 # for enable email sending. EMAIL_HOST_USER should end by @domain.tld
-#EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
-#EMAIL_USE_TLS = False
-#EMAIL_HOST = "localhost"
-#EMAIL_HOST_USER = ""
-#EMAIL_HOST_PASSWORD = ""
-#EMAIL_PORT = 25
-
-# Uncomment and populate with proper connection parameters
-# for enable github login/singin.
-#GITHUB_API_CLIENT_ID = "yourgithubclientid"
-#GITHUB_API_CLIENT_SECRET = "yourgithubclientsecret"
-
+EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
+EMAIL_USE_TLS = False
+EMAIL_HOST = "localhost"
+EMAIL_PORT = 25
+EMAIL_HOST_USER = ""
+# EMAIL_HOST_PASSWORD = ""
+
+# Database config
+DATABASES = {
+    "default": {
+        "ENGINE": "transaction_hooks.backends.postgresql_psycopg2",
+        "NAME": "taiga",
+        "USER": "taiga",
+        "PASSWORD": "changeme",
+        "HOST": "",
+        "PORT": "",
+    }
+}

+ 20 - 10
start.sh

@@ -4,22 +4,22 @@ set -eu -o pipefail
 
 echo "==============="
 
-# RUN python manage.py migrate --noinput
-# RUN python manage.py loaddata initial_user
-# RUN python manage.py loaddata initial_project_templates
-# RUN python manage.py loaddata initial_role
-# RUN python manage.py compilemessages
-# RUN python manage.py collectstatic --noinput
-
-#service circus start
-#service nginx restart
-
 echo "local.py"
 sed -e "s/MEDIA_URL = \".*\"/MEDIA_URL = \"https:\/\/${HOSTNAME}\/media\/\"/" \
     -e "s/STATIC_URL = \".*\"/STATIC_URL = \"https:\/\/${HOSTNAME}\/static\/\"/" \
     -e "s/ADMIN_MEDIA_PREFIX = \".*\"/ADMIN_MEDIA_PREFIX = \"https:\/\/${HOSTNAME}\/static\/admin\/\"/" \
     -e "s/SITES\[\"front\"\]\[\"scheme\"\] = \".*\"/SITES\[\"front\"\]\[\"scheme\"\] = \"https\"/" \
     -e "s/SITES\[\"front\"\]\[\"domain\"\] = \".*\"/SITES\[\"front\"\]\[\"domain\"\] = \"${HOSTNAME}\"/" \
+    -e "s/\"NAME\": \".*\",/\"NAME\": \"${POSTGRESQL_DATABASE}\",/" \
+    -e "s/\"USER\": \".*\",/\"USER\": \"${POSTGRESQL_USERNAME}\",/" \
+    -e "s/\"PASSWORD\": \".*\",/\"PASSWORD\": \"${POSTGRESQL_PASSWORD}\",/" \
+    -e "s/\"HOST\": \".*\",/\"HOST\": \"${POSTGRESQL_HOST}\",/" \
+    -e "s/\"PORT\": \".*\",/\"PORT\": \"${POSTGRESQL_PORT}\",/" \
+
+    -e "s/\"EMAIL_HOST\": \".*\",/\"EMAIL_HOST\": \"${MAIL_SMTP_SERVER}\",/" \
+    -e "s/\"EMAIL_PORT\": \".*\",/\"EMAIL_PORT\": \"${MAIL_SMTP_PORT}\",/" \
+    -e "s/\"EMAIL_HOST_USER\": \".*\",/\"EMAIL_HOST_USER\": \"${MAIL_SMTP_USERNAME}\",/" \
+
     -i /app/code/taiga-back/settings/local.py
 
 echo "update conf.json"
@@ -27,6 +27,16 @@ sed -e "s/\"api\": \".*\",/\"api\": \"https:\/\/${HOSTNAME}\/api\/v1\/\",/" \
     -e "s/\"eventsUrl\": \".*\",/\"eventsUrl\": \"ws:\/\/${HOSTNAME}\/events\",/" \
     -i /app/code/taiga-front-dist/dist/js/conf.json
 
+# cd /app/code/taiga-back/
+# 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
+# python manage.py collectstatic --noinput
+
 echo "update nginx"
+service nginx restart
+#service circus start
 
 read