- database: pg_isready healthcheck; calcom depends_on service_healthy - calcom: healthcheck probes /auth/login with redirects (upstream wget --spider / fails on 307)
59 lines
2.7 KiB
YAML
59 lines
2.7 KiB
YAML
# cal.diy — Commons Computer deployment override (cc branch, issue #11)
|
|
#
|
|
# Usage (from the cc branch checkout):
|
|
# docker compose -f docker-compose.yml -f docker-compose.cc.yml build calcom
|
|
# docker compose -f docker-compose.yml -f docker-compose.cc.yml up -d database redis calcom
|
|
#
|
|
# Changes vs upstream docker-compose.yml:
|
|
# 1. Pin every image at a CC-known-good tag (cal.com, postgres, redis) —
|
|
# reproducibility is the point of this branch. NOTE: cal.diy does NOT
|
|
# publish prebuilt release images (Docker Hub: 0 tags; scarf/ghcr: none),
|
|
# so `calcom` is BUILT from source; the image: line is the local tag the
|
|
# build produces (build args come from .env via the base compose file).
|
|
# 2. Keep `calcom-api` (v2 API) and `studio` (Prisma) OUT of the v1 stack via
|
|
# a reserved profile — not part of the first cutover (issue #11).
|
|
|
|
services:
|
|
# The upstream base file hardcodes database creds
|
|
# (unicorn_user/magical_password) and lets compose build DATABASE_URL from the
|
|
# raw POSTGRES_PASSWORD — both break with generated secrets. CC override:
|
|
# database creds come from .env, and DATABASE_URL is built consistently here.
|
|
# NOTE: passwords in .env MUST be URL-safe (hex) — see cc.env.example.
|
|
database:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
healthcheck:
|
|
# start.sh's wait-for-it passes as soon as the port OPENS (mid-initdb) and
|
|
# prisma migrate then P1001s; the CC stack gates on a real readiness check.
|
|
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
|
|
calcom:
|
|
image: calcom.docker.scarf.sh/calcom/cal.diy:v6.2.0
|
|
environment:
|
|
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}
|
|
DATABASE_DIRECT_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy # start.sh has no `set -e`; gate so its migrate step actually sees a ready DB
|
|
healthcheck:
|
|
# upstream image healthcheck uses `wget --spider /` which fails on the
|
|
# / -> /auth/login 307; probe the login page with redirects instead.
|
|
test: ["CMD-SHELL", "wget -qO- --max-redirect=5 http://127.0.0.1:3000/auth/login >/dev/null || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
|
|
calcom-api:
|
|
profiles: ["off"] # v2 API — add with `--profile api` when needed
|
|
|
|
studio:
|
|
profiles: ["off"] # prisma studio — never in prod; `docker compose run` to use |