Browse Source

moved celery service below misago

Ali 6 years ago
parent
commit
c39387e858
1 changed files with 61 additions and 11 deletions
  1. 61 11
      docker-compose.yaml

+ 61 - 11
docker-compose.yaml

@@ -2,6 +2,45 @@
 # This is not for running your Misago site in docker
 # This is not for running your Misago site in docker
 version: "3.0"
 version: "3.0"
 services:
 services:
+  postgres:
+    image: postgres:10
+    environment:
+      - POSTGRES_USER=misago
+      - POSTGRES_PASSWORD=misago
+    ports:
+      - '127.0.0.1:5432:5432'
+  redis:
+    image: redis:5
+    restart: unless-stopped
+    networks:
+      - misago
+    volumes:
+      - misago-redis:/data
+  misago:
+    build: .
+    command: python manage.py runserver 0.0.0.0:8000
+    environment:
+      # Postgres
+      - POSTGRES_USER=misago
+      - POSTGRES_PASSWORD=misago
+      - POSTGRES_DB=misago
+      - POSTGRES_HOST=postgres
+      - POSTGRES_TEST_DB=misago_test
+      # Superuser
+      - SUPERUSER_USERNAME=Admin
+      - SUPERUSER_EMAIL=admin@example.com
+      - SUPERUSER_PASSWORD=password
+    ports:
+      # Map port 8000 in the container to port 8000 on the host
+      # This way we can access the forum through http://localhost:8000
+      - "${MISAGO_DEVSERVER_PORT:-8000}:8000"
+    depends_on:
+      - postgres
+    tty: true
+    volumes:
+      # Map in the entire project into the container
+      # This makes sure files in the container updates on the fly as we were working locally
+      - .:/srv/misago:Z
   celery:
   celery:
     build: .
     build: .
     command: celery -A tasks worker --loglevel=info
     command: celery -A tasks worker --loglevel=info
@@ -27,23 +66,34 @@ services:
       # Map in the entire project into the container
       # Map in the entire project into the container
       # This makes sure files in the container updates on the fly as we were working locally
       # This makes sure files in the container updates on the fly as we were working locally
       - .:/srv/misago:Z
       - .:/srv/misago:Z
-  postgres:
-    image: postgres:10
+  celery:
+    build: .
+    command: celery -A tasks worker --loglevel=info
     environment:
     environment:
+      # Postgres
       - POSTGRES_USER=misago
       - POSTGRES_USER=misago
       - POSTGRES_PASSWORD=misago
       - POSTGRES_PASSWORD=misago
+      - POSTGRES_DB=misago
+      - POSTGRES_HOST=postgres
+      - POSTGRES_TEST_DB=misago_test
+      # Superuser
+      - SUPERUSER_USERNAME=Admin
+      - SUPERUSER_EMAIL=admin@example.com
+      - SUPERUSER_PASSWORD=password
     ports:
     ports:
-      - '127.0.0.1:5432:5432'
-  redis:
-    image: redis:5
-    restart: unless-stopped
-    networks:
-      - misago
+      # Map port 8000 in the container to port 8000 on the host
+      # This way we can access the forum through http://localhost:8000
+      - "${MISAGO_DEVSERVER_PORT:-8000}:8000"
+    depends_on:
+      - postgres
+    tty: true
     volumes:
     volumes:
-      - misago-redis:/data
-  misago:
+      # Map in the entire project into the container
+      # This makes sure files in the container updates on the fly as we were working locally
+      - .:/srv/misago:Z
+  celery:
     build: .
     build: .
-    command: python manage.py runserver 0.0.0.0:8000
+    command: celery -A tasks worker --loglevel=info
     environment:
     environment:
       # Postgres
       # Postgres
       - POSTGRES_USER=misago
       - POSTGRES_USER=misago