]> Untitled Git - lemmy.git/blobdiff - docker/prod/docker-compose.yml
Fix invalid config in docker/prod (fixes #2520) (#2524)
[lemmy.git] / docker / prod / docker-compose.yml
index fa14c8ed8d6d602252492f89ee4326ff4784cf32..a0fe5cfeb875d3e63f358a42cd41a0e1bf4f23b2 100644 (file)
@@ -1,56 +1,86 @@
-version: '2.2'
+version: "3.3"
+
+networks:
+  # communication to web and clients
+  lemmyexternalproxy:
+  # communication between lemmy services
+  lemmyinternal:
+    driver: bridge
+    internal: true
 
 services:
-  postgres:
-    image: postgres:12-alpine
-    environment:
-      - POSTGRES_USER=lemmy
-      - POSTGRES_PASSWORD=password
-      - POSTGRES_DB=lemmy
+  proxy:
+    image: nginx:1-alpine
+    networks:
+      - lemmyinternal
+      - lemmyexternalproxy
+    ports:
+      # only ports facing any connection from outside
+      - 80:80 
+      - 443:443
     volumes:
-      - ./volumes/postgres:/var/lib/postgresql/data
+      - ./nginx.conf:/etc/nginx/nginx.conf:ro
+      # setup your certbot and letsencrypt config 
+      - ./certbot:/var/www/certbot
+      - ./letsencrypt:/etc/letsencrypt/live
     restart: always
+    depends_on:
+      - pictrs
+      - lemmy-ui
 
   lemmy:
-    image: dessalines/lemmy:0.9.2
-    ports:
-      - "127.0.0.1:8536:8536"
+    image: dessalines/lemmy:0.16.7
+    hostname: lemmy
+    networks:
+      - lemmyinternal
     restart: always
     environment:
-      - RUST_LOG=error
+      - RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
     volumes:
       - ./lemmy.hjson:/config/config.hjson
     depends_on:
       - postgres
       - pictrs
-      - iframely
 
   lemmy-ui:
-    image: dessalines/lemmy-ui:0.9.2
-    ports:
-      - "1235:1234"
-    restart: always
+    image: dessalines/lemmy-ui:0.16.7
+    networks:
+      - lemmyinternal
     environment:
+      # this needs to match the hostname defined in the lemmy service
       - LEMMY_INTERNAL_HOST=lemmy:8536
-      - LEMMY_EXTERNAL_HOST=localhost:8536
-      - LEMMY_HTTPS=false
-    depends_on: 
+      # set the outside hostname here
+      - LEMMY_EXTERNAL_HOST=localhost:1236
+      - LEMMY_HTTPS=true
+    depends_on:
       - lemmy
+    restart: always
 
   pictrs:
-    image: asonix/pictrs:v0.2.5-r0
-    ports: 
-      - "127.0.0.1:8537:8080"
+    image: asonix/pictrs:0.3.1
+    # this needs to match the pictrs url in lemmy.hjson
+    hostname: pictrs
+    # we can set options to pictrs like this, here we set max. image size and forced format for conversion
+    # entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
+    networks:
+      - lemmyinternal
+    environment:
+      - PICTRS__API_KEY=API_KEY
     user: 991:991
     volumes:
       - ./volumes/pictrs:/mnt
     restart: always
 
-  iframely:
-    image: dogbin/iframely:latest
-    ports:
-      - "127.0.0.1:8061:80"
+  postgres:
+    image: postgres:14-alpine
+    # this needs to match the database host in lemmy.hson
+    hostname: postgres
+    networks:
+      - lemmyinternal
+    environment:
+      - POSTGRES_USER=lemmy
+      - POSTGRES_PASSWORD=password
+      - POSTGRES_DB=lemmy
     volumes:
-      - ./iframely.config.local.js:/iframely/config.local.js:ro
+      - ./volumes/postgres:/var/lib/postgresql/data
     restart: always
-    mem_limit: 100m