Skip to content

Instantly share code, notes, and snippets.

@mstdn
Created June 17, 2023 18:56
Show Gist options
  • Save mstdn/fea9fdeaed058700df6813e9ec3a32cf to your computer and use it in GitHub Desktop.
Save mstdn/fea9fdeaed058700df6813e9ec3a32cf to your computer and use it in GitHub Desktop.
version: "3.3"
networks:
# communication to web and clients
lemmyexternalproxy:
# communication between lemmy services
lemmyinternal:
driver: bridge
internal: true
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
# logging:
# driver: "json-file"
# options:
# max-size: "100m"
#
lemmy:
image: dessalines/lemmy:0.17.4
hostname: lemmy
networks:
- lemmyinternal
- lemmyexternalproxy
ports:
- 8536:8536
restart: always
environment:
- RUST_LOG="warn,lemmy_server=warn,lemmy_api=warn,lemmy_api_common=warn,lemmy_api_crud=warn,lemmy_apub=warn,lemmy_db_schema=warn,lemmy_db_views=warn,lemmy_db_views_actor=warn,lemmy_db_views_moderator=warn,lemmy_routes=warn,lemmy_utils=warn,lemmy_websocket=warn"
volumes:
- ./lemmy.hjson:/config/config.hjson
depends_on:
- postgres
- pictrs
logging:
driver: "json-file"
options:
max-size: "100m"
lemmy-ui:
image: dessalines/lemmy-ui:0.17.4
networks:
- lemmyinternal
- lemmyexternalproxy
ports:
- 1234:1234
environment:
# this needs to match the hostname defined in the lemmy service
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
# set the outside hostname here
- LEMMY_UI_LEMMY_EXTERNAL_HOST=u.fail
- LEMMY_HTTPS=true
depends_on:
- lemmy
logging:
driver: "json-file"
options:
max-size: "100m"
restart: always
pictrs:
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
logging:
driver: "json-file"
options:
max-size: "100m"
restart: always
postgres:
image: postgres:15-alpine
# this needs to match the database host in lemmy.hson
hostname: postgres
networks:
- lemmyinternal
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=CustomPassword
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
shm_size: 6g
logging:
driver: "json-file"
options:
max-size: "100m"
restart: always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment