]> git.parisson.com Git - teleforma.git/commitdiff
Splitting dev into asgi/wsgi too so it's closer to prod
authorGael Le Mignot <gael@pilotsystems.net>
Wed, 30 Jun 2021 13:57:44 +0000 (15:57 +0200)
committerGael Le Mignot <gael@pilotsystems.net>
Wed, 30 Jun 2021 13:57:44 +0000 (15:57 +0200)
app/asgi.sh
app/wsgi.sh
docker-compose-dev.yml

index 0546b3ed156a1ea940caebbf967a198ec1281ee7..ec155187a847cf23460b45b8f82a5b6be62235d0 100755 (executable)
@@ -1,3 +1,19 @@
+#!/bin/bash
+
+# paths
+app='/srv/app'
+manage=$app'/manage.py'
+static='/srv/static/'
+media='/srv/media/'
+src='/srv/src/'
+
+if [ "$1" = "--runserver" ]; then
+    python $manage runserver 0.0.0.0:8000
+else
+    # static files auto update
+    # watchmedo shell-command --patterns="$patterns" --recursive \
+    #     --command='python '$manage' collectstatic --noinput' $app &
+    daphne -b 0.0.0.0 -p 8000 asgi:application
+fi
 
-daphne -b 0.0.0.0 -p 8000 asgi:application
 
index ca4238f8ece85b05cc518c02220f20a703b2e803..43859828ee8bd9c3311a702747adca4fdf39e796 100755 (executable)
@@ -35,7 +35,7 @@ sh $app/wait.sh
 
 # app start
 if [ "$1" = "--runserver" ]; then
-    python $manage runserver 0.0.0.0:8000
+    python $manage runserver 0.0.0.0:8000 --noasgi
 else
     # static files auto update
     # watchmedo shell-command --patterns="$patterns" --recursive \
index e6cd57134d4b72ce3af4f08f99e410856189144b..a4bd6eb2ed78bc9e7d3a94e631cb204d8b66d387 100644 (file)
@@ -21,7 +21,31 @@ services:
       - postgres
       - redis
     ports:
-       - "9000:8000"
+       - "8000:8000"
+    env_file:
+       - 'env/debug.env'
+
+  channels:
+    build:
+      context: .
+      args:
+        dev: 1
+    command: /bin/sh /srv/app/asgi.sh --runserver
+    volumes:
+      - ./app/:/srv/app
+      - ./bin:/srv/bin
+      - ./lib:/srv/lib
+      - ./teleforma/:/srv/src/teleforma/teleforma
+      - ./var/media:/srv/media
+      - ./var/backup:/srv/backup
+      - ./var/static:/srv/static
+      - ./var/log/app:/var/log/app
+      - ./var/log/uwsgi:/var/log/uwsgi
+    links:
+      - postgres
+      - redis
+    ports:
+       - "8001:8000"
     env_file:
        - 'env/debug.env'