mirror of
https://github.com/rybbit-io/rybbit.git
synced 2025-05-10 20:05:38 +02:00
* Allow setting all variables in .env file * Fix postgres version * pin versions * bump --------- Co-authored-by: pe1uca <edga.alva@gmail.com>
97 lines
2.8 KiB
YAML
97 lines
2.8 KiB
YAML
services:
|
|
caddy:
|
|
image: caddy:2.10.0
|
|
container_name: caddy
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
- "443:443/udp" # Needed for HTTP/3
|
|
volumes:
|
|
- ./Caddyfile:/etc/caddy/Caddyfile # Mount Caddy config file
|
|
- caddy_data:/data # Mount persistent data volume for certs etc.
|
|
- caddy_config:/config # Mount persistent config volume
|
|
environment:
|
|
# Pass domain name for use in Caddyfile
|
|
# Email is configured via Caddyfile global options
|
|
- DOMAIN_NAME=${DOMAIN_NAME}
|
|
depends_on:
|
|
- backend
|
|
- client
|
|
|
|
clickhouse:
|
|
container_name: clickhouse
|
|
image: clickhouse/clickhouse-server:25.4.2
|
|
ports:
|
|
- "8123:8123"
|
|
- "9000:9000"
|
|
volumes:
|
|
- clickhouse-data:/var/lib/clickhouse
|
|
- ./clickhouse_config:/etc/clickhouse-server/config.d
|
|
environment:
|
|
- CLICKHOUSE_DB=${CLICKHOUSE_DB:-analytics}
|
|
- CLICKHOUSE_USER=${CLICKHOUSE_USER:-default}
|
|
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-frog}
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8123/ping"]
|
|
interval: 3s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
restart: unless-stopped
|
|
|
|
postgres:
|
|
image: postgres:17.4
|
|
container_name: postgres
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER:-frog}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-frog}
|
|
- POSTGRES_DB=${POSTGRES_DB:-analytics}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
|
|
backend:
|
|
container_name: backend
|
|
build:
|
|
context: ./server
|
|
dockerfile: Dockerfile
|
|
environment:
|
|
- NODE_ENV=production
|
|
- CLICKHOUSE_HOST=http://clickhouse:8123
|
|
- CLICKHOUSE_DB=${CLICKHOUSE_DB:-analytics}
|
|
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-frog}
|
|
- POSTGRES_HOST=postgres
|
|
- POSTGRES_PORT=5432
|
|
- POSTGRES_DB=${POSTGRES_DB:-analytics}
|
|
- POSTGRES_USER=${POSTGRES_USER:-frog}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-frog}
|
|
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
|
|
- BASE_URL=${BASE_URL}
|
|
- DISABLE_SIGNUP=${DISABLE_SIGNUP}
|
|
depends_on:
|
|
clickhouse:
|
|
condition: service_healthy
|
|
postgres:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
|
|
client:
|
|
container_name: client
|
|
build:
|
|
context: ./client
|
|
dockerfile: Dockerfile
|
|
args:
|
|
NEXT_PUBLIC_BACKEND_URL: ${BASE_URL}
|
|
environment:
|
|
- NODE_ENV=production
|
|
- NEXT_PUBLIC_BACKEND_URL=${BASE_URL}
|
|
depends_on:
|
|
- backend
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
clickhouse-data:
|
|
postgres-data:
|
|
caddy_data: # Persistent volume for Caddy's certificates and state
|
|
caddy_config: # Persistent volume for Caddy's configuration cache (optional but good practice)
|