-
-
Save hjalp/bc3a963bd572e46e4e2bf69f9ecc3452 to your computer and use it in GitHub Desktop.
Compose file for Lemmy deployment with Caddy
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.9" | |
x-logging: | |
&default-logging | |
options: | |
max-size: '10m' | |
driver: json-file | |
services: | |
caddy: | |
image: caddy:2 | |
ports: | |
- 80:80 | |
- 443:443 | |
volumes: | |
- ./volumes/caddy:/data | |
- ./volumes/caddy:/config | |
# See Caddy's documentation for customizing this line | |
# https://caddyserver.com/docs/quick-starts/reverse-proxy | |
command: | |
- /bin/sh | |
- -c | |
- | | |
cat <<EOF > /etc/caddy/Caddyfile && caddy run --config /etc/caddy/Caddyfile | |
{ | |
debug | |
} | |
(common) { | |
encode gzip | |
header { | |
-Server | |
Strict-Transport-Security "max-age=31536000; include-subdomains;" | |
X-XSS-Protection "1; mode=block" | |
X-Frame-Options "DENY" | |
X-Content-Type-Options nosniff | |
Referrer-Policy no-referrer-when-downgrade | |
X-Robots-Tag "none" | |
} | |
} | |
# Lemmy instance | |
lemmy.emphisia.nl { | |
log | |
import common | |
reverse_proxy http://lemmy-ui:1234 # lemmy-ui | |
@lemmy { | |
path /api/* | |
path /pictrs/* | |
path /feeds/* | |
path /nodeinfo/* | |
path /.well-known/* | |
} | |
@lemmy-hdr { | |
header Accept application/* | |
} | |
handle @lemmy { | |
reverse_proxy http://lemmy:8085 # lemmy | |
} | |
handle @lemmy-hdr { | |
reverse_proxy http://lemmy:8085 | |
} | |
@lemmy-post { | |
method POST | |
} | |
handle @lemmy-post { | |
reverse_proxy http://lemmy:8085 | |
} | |
} | |
EOF | |
lemmy: | |
image: dessalines/lemmy:0.18.1-rc.9 | |
ports: | |
- 8085:8536 | |
volumes: | |
- ./volumes/lemmy.hjson:/config/config.hjson | |
depends_on: | |
- postgres | |
- pictrs | |
restart: always | |
logging: *default-logging | |
lemmy-ui: | |
image: dessalines/lemmy-ui:0.18.1-rc.9 | |
ports: | |
- 1234:1234 | |
environment: | |
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8085 | |
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236 | |
depends_on: | |
- lemmy | |
volumes: | |
- ./volumes/lemmy-ui/extra_themes:/app/extra_themes | |
restart: always | |
logging: *default-logging | |
postgres: | |
image: postgres:15-alpine | |
ports: | |
- 5432:5432 | |
environment: | |
- POSTGRES_USER=MyPostgresUser | |
- POSTGRES_DB=MyPostgresDB | |
- POSTGRES_PASSWORD=MyPostgresPassword | |
volumes: | |
- ./volumes/postgres:/var/lib/postgresql/data | |
restart: always | |
logging: *default-logging | |
pictrs: | |
image: asonix/pictrs:0.4.0-rc.7 | |
user: 991:991 | |
hostname: pictrs | |
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 | |
volumes: | |
- ./volumes/pictrs:/mnt | |
restart: always | |
logging: *default-logging | |
postfix: | |
image: mwader/postfix-relay | |
environment: | |
- POSTFIX_myhostname=lemmy.emphisia.nl | |
restart: "always" | |
logging: *default-logging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment