Sfoglia il codice sorgente

virtualenv does not work in docker

Johannes Zellner 9 anni fa
parent
commit
e8f61ab8fa
3 ha cambiato i file con 22 aggiunte e 12 eliminazioni
  1. 1 0
      CloudronManifest.json
  2. 0 8
      Dockerfile
  3. 21 4
      start.sh

+ 1 - 0
CloudronManifest.json

@@ -9,6 +9,7 @@
   "httpPort": 8000,
   "addons": {
     "localstorage": {},
+    "sendmail": {},
     "postgresql": {}
   },
   "minBoxVersion": "0.0.1",

+ 0 - 8
Dockerfile

@@ -16,19 +16,11 @@ RUN apt-get install -y postgresql-9.4 postgresql-contrib-9.4 postgresql-server-d
 RUN apt-get install -y nginx
 
 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 pip install -r requirements.txt
 
 ## frontend
 WORKDIR /app/code

+ 21 - 4
start.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 
-set -eu -o pipefail
+# set -eu -o pipefail
 
 echo "==============="
 
@@ -15,11 +15,9 @@ sed -e "s/MEDIA_URL = \".*\"/MEDIA_URL = \"https:\/\/${HOSTNAME}\/media\/\"/" \
     -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"
@@ -38,6 +36,25 @@ sed -e "s/\"api\": \".*\",/\"api\": \"https:\/\/${HOSTNAME}\/api\/v1\/\",/" \
 echo "update nginx"
 service nginx restart
 
-/usr/local/bin/circusd /app/code/circus.ini
+echo "setup taiga"
+cd /app/code
+virtualenv -p /usr/bin/python3.4 taiga
+source /app/code/taiga/bin/activate
+
+python --version
+
+echo "install pip"
+easy_install pip
+
+echo "install circus"
+pip install circus
+
+echo "install taiga deps"
+cd /app/code/taiga-back
+pip install -r requirements.txt
+
+cd /app/code
+
+# /usr/local/bin/circusd /app/code/circus.ini
 
 read