Created
June 4, 2023 10:46
-
-
Save hmmcclish/b55aadd03e85ac4f6b6efee413dc3068 to your computer and use it in GitHub Desktop.
lemmy docker-compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
# https://docs.docker.com/compose/compose-file/compose-file-v3/ | |
# https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields | |
services: | |
proxy: | |
image: nginx:1-alpine | |
networks: | |
- lemmy | |
- traefik | |
environment: | |
# Required by NGINX | |
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx | |
# https://nginx.org/en/docs/ngx_core_module.html#worker_processes | |
- NGINX_WORKER_PROCESSES=auto | |
# https://nginx.org/en/docs/ngx_core_module.html#worker_rlimit_nofile | |
- NGINX_WORKER_RLIMIT_NOFILE=65535 | |
# https://nginx.org/en/docs/ngx_core_module.html#worker_connections | |
- NGINX_WORKER_CONNECTIONS=65535 | |
# https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size | |
- NGINX_CLIENT_MAX_BODY_SIZE=10m | |
# https://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout | |
- NGINX_CLIENT_BODY_TIMEOUT=30s | |
# https://nginx.org/en/docs/http/server_names.html | |
- NGINX_HOST=lemmy.mydomain.net | |
configs: | |
- source: lemmy-nginx.conf | |
target: /etc/nginx/templates/nginx.conf.template | |
deploy: # https://docs.docker.com/compose/compose-file/compose-file-v3/#deploy | |
labels: # https://docs.docker.com/compose/compose-file/compose-file-v3/#labels-1 | |
# Essential traefik labels https://doc.traefik.io/traefik/providers/docker/ | |
- "traefik.enable=true" | |
- "traefik.http.routers.lemmy.rule=Host(`lemmy.mydomain.net`)" | |
- "traefik.http.routers.lemmy.entrypoints=websecure" | |
- "traefik.http.services.lemmy.loadbalancer.server.port=1236" # Port traefik needs to route traffic to | |
# Enable middlewares | |
- "traefik.http.routers.lemmy.middlewares=default_circuitbreaker@file,default_security_headers@file" | |
postgres: | |
image: postgres:15-alpine | |
environment: | |
- POSTGRES_USER=lemmy | |
- POSTGRES_PASSWORD_FILE=/run/secrets/lemmy_postgres_password | |
- POSTGRES_DB=lemmy | |
secrets: | |
- lemmy_postgres_password | |
networks: | |
- lemmy | |
volumes: | |
- lemmy-postgres:/var/lib/postgresql/data | |
lemmy: | |
image: dessalines/lemmy:0.17.3 | |
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" | |
networks: | |
- lemmy | |
configs: | |
- source: lemmy.hjson | |
target: /config/config.hjson | |
lemmy-ui: | |
image: dessalines/lemmy-ui:0.17.3 | |
environment: | |
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536 | |
- LEMMY_UI_LEMMY_EXTERNAL_HOST=lemmy.mydomain.net | |
- LEMMY_HTTPS=true | |
networks: | |
- lemmy | |
volumes: | |
- lemmy-ui-themes:/app/extra_themes | |
pictrs: | |
image: asonix/pictrs:0.3.3 | |
networks: | |
- lemmy | |
environment: | |
- PICTRS__MEDIA__VIDEO_CODEC=vp9 | |
- PICTRS__MEDIA__GIF__MAX_WIDTH=256 | |
- PICTRS__MEDIA__GIF__MAX_HEIGHT=256 | |
- PICTRS__MEDIA__GIF__MAX_AREA=65536 | |
- PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400 | |
user: 991:991 | |
volumes: | |
- pictrs-data:/mnt | |
configs: # https://docs.docker.com/compose/compose-file/compose-file-v3/#configs-configuration-reference | |
lemmy.hjson: | |
external: true | |
lemmy-nginx.conf: | |
external: true | |
networks: # https://docs.docker.com/compose/compose-file/compose-file-v3/#network-configuration-reference | |
lemmy: | |
traefik: | |
external: true | |
secrets: # https://docs.docker.com/compose/compose-file/compose-file-v3/#secrets-configuration-reference | |
lemmy_postgres_password: | |
external: true | |
volumes: # https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference | |
lemmy-postgres: | |
lemmy-ui-themes: | |
pictrs-data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment