Skip to content

Instantly share code, notes, and snippets.

@hiteshchoudhary
Created March 31, 2026 10:41
Show Gist options
  • Select an option

  • Save hiteshchoudhary/8ce7df3ec53ae0dfc6065f206da86f76 to your computer and use it in GitHub Desktop.

Select an option

Save hiteshchoudhary/8ce7df3ec53ae0dfc6065f206da86f76 to your computer and use it in GitHub Desktop.
services:
caddy:
image: caddy:alpine
depends_on:
- app
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- caddy_data:/data
- caddy_config:/config
command: >
sh -c 'printf "thecodinghero.com {\n reverse_proxy app:3001\n}\nadmin.thecodinghero.com {\n reverse_proxy app:3002\n}\n" > /etc/caddy/Caddyfile && caddy run --config /etc/caddy/Caddyfile'
restart: unless-stopped
app:
depends_on:
postgres:
condition: service_healthy
image: svhd/logto:${TAG-latest}
entrypoint: ["sh", "-c", "npm run cli db seed -- --swe && npm start"]
expose:
- 3001
- 3002
environment:
- TRUST_PROXY_HEADER=1
- DB_URL=postgres://postgres:p0stgr3s@postgres:5432/logto
- ENDPOINT=https://thecodinghero.com
- ADMIN_ENDPOINT=https://admin.thecodinghero.com
restart: unless-stopped
postgres:
image: postgres:17-alpine
user: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: p0stgr3s
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
caddy_data:
caddy_config:
postgres_data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment