The doc said two stages had none and nothing carried a magnitude. Both were true when written this morning and are not now, and a setup guide that understates what exists sends an operator looking for something they already have. Adds what photometry needs before it will run — gain in electrons per ADU, read noise, full well — and why the header's GAIN is deliberately not a fallback for the first of those. Astrometry is still unbuilt, and the entry now says why that does not block photometry. Compose picks up the photometry stage. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
117 lines
4.4 KiB
YAML
117 lines
4.4 KiB
YAML
# Caelum self-host stack.
|
|
#
|
|
# docker compose up -d # boot MySQL + the app
|
|
# docker compose logs -f app # tail the server logs
|
|
# docker compose exec app sh # shell into the app container
|
|
# docker compose down # stop everything (data persists)
|
|
# docker compose down -v # nuke the database volume too
|
|
#
|
|
# After first boot, run the seed once to create the admin/observer accounts
|
|
# and sample sites/telescopes:
|
|
#
|
|
# docker compose exec app sh -c "cd server && npm run seed"
|
|
#
|
|
# Defaults assume a single-host deployment. For production behind a reverse
|
|
# proxy, set CAELUM_PORT and bind the proxy in front of localhost:${CAELUM_PORT}.
|
|
|
|
services:
|
|
db:
|
|
image: mysql:8.4
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-change-me-root}
|
|
MYSQL_DATABASE: ${MYSQL_DATABASE:-caelum_app}
|
|
MYSQL_USER: ${MYSQL_USER:-caelum}
|
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-change-me}
|
|
# caching_sha2_password is the default since 8.0; the previous
|
|
# --default-authentication-plugin flag was removed in 8.4 entirely.
|
|
command: >
|
|
--character-set-server=utf8mb4
|
|
--collation-server=utf8mb4_unicode_ci
|
|
volumes:
|
|
- caelum-db:/var/lib/mysql
|
|
# Optional second DB (SpaceDB / NASA-JPL catalog). Toggle via env.
|
|
- ./docker/initdb:/docker-entrypoint-initdb.d:ro
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", "-p${MYSQL_ROOT_PASSWORD:-change-me-root}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 30s
|
|
# No host port published by default. Add a "ports:" stanza locally if you
|
|
# want to connect with a MySQL client from the host.
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: 3002
|
|
# App database
|
|
MYSQL_HOST: db
|
|
MYSQL_PORT: 3306
|
|
MYSQL_USER: ${MYSQL_USER:-caelum}
|
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-change-me}
|
|
MYSQL_DATABASE: ${MYSQL_DATABASE:-caelum_app}
|
|
# SpaceDB (optional; leave empty to disable /spacedb routes)
|
|
MYSQL_SPACEDB_HOST: db
|
|
MYSQL_SPACEDB_PORT: 3306
|
|
MYSQL_SPACEDB_USER: ${MYSQL_USER:-caelum}
|
|
MYSQL_SPACEDB_PASSWORD: ${MYSQL_PASSWORD:-change-me}
|
|
MYSQL_SPACEDB_DATABASE: ${MYSQL_SPACEDB_DATABASE:-}
|
|
# Auth
|
|
JWT_SECRET: ${JWT_SECRET:-change-me-to-a-random-string}
|
|
ports:
|
|
- "${CAELUM_PORT:-3002}:3002"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3002/api/health"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
# The reduction sidecar. Off by default, because it needs a token that only
|
|
# exists after someone creates one:
|
|
#
|
|
# docker compose --profile reduction up -d
|
|
#
|
|
# Create the token from the UI, or:
|
|
# curl -X POST localhost:3002/api/tokens -H 'Authorization: Bearer <session>' \
|
|
# -H 'Content-Type: application/json' \
|
|
# -d '{"name":"reduction sidecar","scopes":"reduction"}'
|
|
#
|
|
# The `reduction` scope is not account-wide write (see middleware/auth.js), so
|
|
# this container's credential can claim and report reduction jobs and nothing
|
|
# else. Do not give it a `daemon` or `write` token instead; it would work, and
|
|
# it would hand an unattended container the owner's whole account.
|
|
reduce:
|
|
profiles: ["reduction"]
|
|
build:
|
|
context: ./sidecar
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
depends_on:
|
|
app:
|
|
condition: service_healthy
|
|
environment:
|
|
CAELUM_API_URL: http://app:3002
|
|
CAELUM_WORKER_TOKEN: ${CAELUM_WORKER_TOKEN:?set CAELUM_WORKER_TOKEN to a cae_ token with the reduction scope}
|
|
CAELUM_WORKER_ID: ${CAELUM_WORKER_ID:-compose-reduce}
|
|
# Only the stages this build implements. Leaving it unset would have the
|
|
# worker claim astrometry and photometry too, and fail every one of them
|
|
# as unimplemented, which looks like a broken queue.
|
|
CAELUM_WORKER_STAGES: ${CAELUM_WORKER_STAGES:-timing,calibrate,extract,photometry}
|
|
# Cross-check solved frames against Gaia after extraction. Off by
|
|
# default: it reaches the network on every frame and leans on a public
|
|
# catalogue service.
|
|
CAELUM_ASTROMETRY_CHECK: ${CAELUM_ASTROMETRY_CHECK:-0}
|
|
CAELUM_LOG_LEVEL: ${CAELUM_LOG_LEVEL:-INFO}
|
|
|
|
volumes:
|
|
caelum-db:
|