Lemmy docker compose

Created Diff never expires
22 removals
86 lines
4 additions
68 lines
version: "3.3"
version: "3.3"


networks:
networks:
# communication to web and clients
lemmyexternalproxy:
# communication between lemmy services
# communication between lemmy services
lemmyinternal:
lemmyinternal:
driver: bridge
driver: bridge
internal: true


services:
services:
proxy:
image: nginx:1-alpine
networks:
- lemmyinternal
- lemmyexternalproxy
ports:
# only ports facing any connection from outside
- 80:80
- 443:443
volumes:
- ./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:
lemmy:
image: dessalines/lemmy:0.17.3
image: dessalines/lemmy:0.17.3
hostname: lemmy
hostname: lemmy
networks:
networks:
- lemmyinternal
- lemmyinternal
restart: always
restart: always
ports:
- '127.0.0.1:8536:8536'
environment:
environment:
- 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"
- 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:
volumes:
- ./lemmy.hjson:/config/config.hjson
- ./lemmy.hjson:/config/config.hjson
depends_on:
depends_on:
- postgres
- postgres
- pictrs
- pictrs


lemmy-ui:
lemmy-ui:
image: dessalines/lemmy-ui:0.17.3
image: dessalines/lemmy-ui:0.17.3
networks:
networks:
- lemmyinternal
- lemmyinternal
ports:
- '127.0.0.1:8540:1234'
environment:
environment:
# this needs to match the hostname defined in the lemmy service
# this needs to match the hostname defined in the lemmy service
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
# set the outside hostname here
# set the outside hostname here
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
- LEMMY_HTTPS=true
- LEMMY_HTTPS=true
depends_on:
depends_on:
- lemmy
- lemmy
restart: always
restart: always


pictrs:
pictrs:
image: asonix/pictrs:0.3.1
image: asonix/pictrs:0.3.1
# this needs to match the pictrs url in lemmy.hjson
# this needs to match the pictrs url in lemmy.hjson
hostname: pictrs
hostname: pictrs
# we can set options to pictrs like this, here we set max. image size and forced format for conversion
# 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
# entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
networks:
networks:
- lemmyinternal
- lemmyinternal
environment:
environment:
- PICTRS__API_KEY=API_KEY
- PICTRS__API_KEY=API_KEY
user: 991:991
user: 991:991
volumes:
volumes:
- ./volumes/pictrs:/mnt
- ./volumes/pictrs:/mnt
restart: always
restart: always


postgres:
postgres:
image: postgres:15-alpine
image: postgres:15-alpine
# this needs to match the database host in lemmy.hson
# this needs to match the database host in lemmy.hson
hostname: postgres
hostname: postgres
networks:
networks:
- lemmyinternal
- lemmyinternal
environment:
environment:
- POSTGRES_USER=lemmy
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
- POSTGRES_DB=lemmy
volumes:
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
- ./volumes/postgres:/var/lib/postgresql/data
restart: always
restart: always