Ver Fonte

Initial app resources

Johannes Zellner há 9 anos atrás
pai
commit
b3d46694c2
5 ficheiros alterados com 143 adições e 0 exclusões
  1. 35 0
      Dockerfile
  2. 5 0
      circus.conf
  3. 34 0
      circus.ini
  4. 17 0
      start.sh
  5. 52 0
      taiga.nginx.conf

+ 35 - 0
Dockerfile

@@ -2,3 +2,38 @@ FROM cloudron/base:0.3.1
 MAINTAINER Taiga Authors <support@cloudron.io>
 
 EXPOSE 8000
+
+RUN apt-get update
+RUN apt-get install -y build-essential binutils-doc autoconf flex bison libjpeg-dev
+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 libxml2-dev libxslt-dev
+
+RUN apt-get install -y nginx
+
+## backend
+WORKDIR /app/code
+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 pip install -r requirements.txt
+
+## frontend
+WORKDIR /app/code
+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
+
+ADD circus.ini /app/code/circus.ini
+ADD circus.conf /etc/init/circus.conf
+RUN rm /etc/nginx/sites-enabled/default
+ADD taiga.nginx.conf /etc/nginx/sites-enabled/taiga
+ADD start.sh /app/code/start.sh
+
+CMD [ "/app/code/start.sh" ]

+ 5 - 0
circus.conf

@@ -0,0 +1,5 @@
+start on filesystem and net-device-up IFACE=lo
+stop on runlevel [016]
+
+respawn
+exec /usr/local/bin/circusd /app/code/circus.ini

+ 34 - 0
circus.ini

@@ -0,0 +1,34 @@
+
+
+[circus]
+check_delay = 5
+endpoint = tcp://127.0.0.1:5555
+pubsub_endpoint = tcp://127.0.0.1:5556
+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
+numprocesses = 1
+autostart = true
+send_hup = true
+stdout_stream.class = FileStream
+stdout_stream.filename = /var/log/gunicorn.stdout.log
+stdout_stream.max_bytes = 10485760
+stdout_stream.backup_count = 4
+stderr_stream.class = FileStream
+stderr_stream.filename = /var/log/gunicorn.stderr.log
+stderr_stream.max_bytes = 10485760
+stderr_stream.backup_count = 4
+
+[env:taiga]
+PATH = /app/code/.virtualenvs/taiga/bin:$PATH
+TERM=rxvt-256color
+SHELL=/bin/bash
+USER=taiga
+LANG=en_US.UTF-8
+HOME=/app/code
+PYTHONPATH=/app/code/.virtualenvs/taiga/lib/python3.4/site-packages
+

+ 17 - 0
start.sh

@@ -0,0 +1,17 @@
+#!/bin/bash
+
+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
+
+read

+ 52 - 0
taiga.nginx.conf

@@ -0,0 +1,52 @@
+
+
+server {
+    listen 8000 default_server;
+    server_name _;
+
+    large_client_header_buffers 4 32k;
+    client_max_body_size 50M;
+    charset utf-8;
+
+    access_log /var/log/nginx.access.log;
+    error_log /var/log/nginx.error.log;
+
+    # Frontend
+    location / {
+        root /app/code/taiga-front-dist/dist/;
+        try_files $uri $uri/ /index.html;
+    }
+
+    # Backend
+    location /api {
+        proxy_set_header Host $http_host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Scheme $scheme;
+        proxy_set_header X-Forwarded-Proto $scheme;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_pass http://127.0.0.1:8001/api;
+        proxy_redirect off;
+    }
+
+    # Django admin access (/admin/)
+    location /admin {
+        proxy_set_header Host $http_host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Scheme $scheme;
+        proxy_set_header X-Forwarded-Proto $scheme;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_pass http://127.0.0.1:8001$request_uri;
+        proxy_redirect off;
+    }
+
+    # Static files
+    location /static {
+        alias /app/code/taiga-back/static;
+    }
+
+    # Media files
+    location /media {
+        alias /app/code/taiga-back/media;
+    }
+}
+