diff --git a/lemmy/separate-domains.yaml b/lemmy/separate-domains.yaml new file mode 100644 index 0000000..b5fb1e3 --- /dev/null +++ b/lemmy/separate-domains.yaml @@ -0,0 +1,95 @@ +x-logging: &a1 + driver: json-file + options: + max-size: 50m + max-file: "4" +services: + lemmy: + image: dessalines/lemmy:0.19.10 + hostname: lemmy + restart: always + logging: *a1 + environment: + - RUST_LOG="warn" + # - RUST_LOG=lemmy_federate=trace + volumes: + - /path/to/lemmy.hjson:/config/config.hjson:Z + depends_on: + - postgres + - pictrs + networks: + - proxy + - backend + labels: + - traefik.enable=true + - traefik.http.services.lemmy-test.loadbalancer.server.port=8536 + - traefik.http.services.lemmy-test.loadbalancer.server.scheme=http + - traefik.http.routers.lemmy-test-https.entrypoints=websecure + - traefik.http.routers.lemmy-test-https.service=lemmy-test + - traefik.http.routers.lemmy-test-https.rule=Host(`short.domain`) && + (PathPrefix(`/api`) || PathPrefix(`/pictrs`) || PathPrefix(`/feeds`) || + PathPrefix(`/nodeinfo`) || PathPrefix(`/.well-known`) || Method(`POST`) + || HeaderRegexp(`Accept`, `^[Aa]pplication/.*`)) + - traefik.http.routers.lemmy-test-https.tls=true + - traefik.http.routers.lemmy-test-https.tls.certresolver=myresolver + alexandrite: + image: ghcr.io/sheodox/alexandrite:latest + networks: + - proxy + labels: + - traefik.enable=true + - traefik.http.services.lemmy-test-ui.loadbalancer.server.port=3000 + - traefik.http.services.lemmy-test-ui.loadbalancer.server.scheme=http + - traefik.http.routers.lemmy-test-ui-https.entrypoints=websecure + - traefik.http.routers.lemmy-test-ui-https.service=lemmy-test-ui + - traefik.http.routers.lemmy-test-ui-https.rule=Host(`lemmy.your.domain`) + - traefik.http.routers.lemmy-test-ui-https.tls=true + - traefik.http.routers.lemmy-test-ui-https.tls.certresolver=myresolver + environment: + # example config only allowing logins to example.com + # with no links to Lemmy docs, or an instance list + ALEXANDRITE_DEFAULT_INSTANCE: short.domain + ALEXANDRITE_WELCOME_LEMMY_HELP: false + ALEXANDRITE_WELCOME_INSTANCE_HELP: false + ALEXANDRITE_FORCE_INSTANCE: short.domain + pictrs: + image: asonix/pictrs:0.5.16 + # 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 + environment: + - PICTRS_OPENTELEMETRY_URL=http://otel:4137 + - PICTRS__SERVER__API_KEY=${POSTGRES_PASSWORD} + - RUST_BACKTRACE=full + - PICTRS__MEDIA__VIDEO__VIDEO_CODEC=vp9 + - PICTRS__MEDIA__ANIMATION__MAX_WIDTH=256 + - PICTRS__MEDIA__ANIMATION__MAX_HEIGHT=256 + - PICTRS__MEDIA__ANIMATION__MAX_FRAME_COUNT=400 + user: 991:991 + volumes: + - /path/to/pictrs:/mnt:Z + restart: always + networks: + - backend + logging: *a1 + postgres: + image: pgautoupgrade/pgautoupgrade:17-alpine + hostname: postgres + environment: + - POSTGRES_USER=lemmy + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=lemmy + shm_size: 2g + volumes: + - /path/to/data:/var/lib/postgresql/data:Z + - /path/to/customPostgresql.conf:/etc/postgresql.conf + restart: always + networks: + - backend + logging: *a1 +networks: + proxy: + external: true + backend: + external: true