Docker and testing changes
[wolnelektury.git] / docker-compose.yml
index bda15bb..55a09d8 100644 (file)
@@ -1,7 +1,7 @@
 x-app-base: &app-base
   build:
     context: .
-    target: dev
+    target: deps
     args:
       UID: ${UID:-1000}
       GID: ${GID:-1000}
@@ -26,16 +26,19 @@ x-app-base: &app-base
 services:
   web:
     <<: *app-base
-    ports:
-     - "8000:8000"
     command: ./manage.py runserver 0.0.0.0:8000
+    ports:
+      # Dev: use http://localhost:8000/ directly
+      - "127.0.0.1:8000:8000"
 
   celery:
     <<: *app-base
     command: celery -A wolnelektury worker -l info
 
   db:
-    image: postgres:18
+    build:
+      context: .
+      target: postgres
     env_file:
       - .env
     volumes:
@@ -47,6 +50,24 @@ services:
   memcached:
     image: memcached:1.6-alpine
 
+  nginx:
+    # Just for testing production-like environment.
+    # docker compose --profile nginx up
+    profiles: ["nginx"]
+    build:
+      context: .
+      target: nginx
+      args:
+        UID: ${UID:-1000}
+        GID: ${GID:-1000}
+    ports:
+      - "127.0.0.1:8101:80"
+    volumes:
+      - ./var/media:/app/var/media:ro
+      - ./scripts/nginx.conf:/etc/nginx/conf.d/default.conf:ro
+    depends_on:
+      - web
+
 
 volumes:
-  ipython:
\ No newline at end of file
+  ipython: