Skip to content

Instantly share code, notes, and snippets.

@kubo6472
Created October 28, 2024 05:11
Show Gist options
  • Save kubo6472/fe613a50b677127c61af880d36b4b742 to your computer and use it in GitHub Desktop.
Save kubo6472/fe613a50b677127c61af880d36b4b742 to your computer and use it in GitHub Desktop.
gist of docker compose with caddy for riven
#version: "3.8" #can be omitted nowadays
networks:
caddy:
external: true
default:
volumes:
caddy_data: {}
services:
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine #use the alpine based one
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=caddy
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- caddy_data:/data
restart: unless-stopped
watchtower:
image: containrrr/watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
riven-frontend:
networks:
- default
- caddy
labels:
caddy: riven.example.com
caddy.reverse_proxy: "{{upstreams 3000}}"
image: spoked/riven-frontend:latest
container_name: riven-frontend
restart: unless-stopped
# ports:
# - "3000:3000"
tty: true
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- ORIGIN=https://riven.example.com # set to the url or ip where the frontend is hosted
- BACKEND_URL=http://riven:8080 #this works bcs docker
- DIALECT=postgres
- DATABASE_URL=postgres://postgres:postgres@riven-db/riven
depends_on:
riven:
condition: service_healthy
riven:
image: spoked/riven:latest
container_name: riven
restart: unless-stopped
ports:
- "8080:8080"
tty: true
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- RIVEN_FORCE_ENV=true
- RIVEN_DATABASE_HOST=postgresql+psycopg2://postgres:postgres@riven-db/riven
healthcheck:
test: curl -s http://localhost:8080 >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 10
volumes:
- ./data:/riven/data
- /mnt:/mnt
depends_on:
riven_postgres:
condition: service_healthy
riven_postgres:
image: postgres:17.0-alpine3.20
container_name: riven-db
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: riven
volumes:
- ./riven-db:/var/lib/postgresql/data/pgdata
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment