ci / lint (pull_request) Successful in 10s
ci / server (mysql) (pull_request) Successful in 11s
ci / nox (pull_request) Successful in 11s
ci / sidecar (pull_request) Failing after 8s
ci / server (sqlite) (pull_request) Successful in 13s
ci / client (pull_request) Successful in 26s
ci / image (pull_request) Skipped
ci / sourcemaps (pull_request) Skipped
ci / deploy (pull_request) Skipped
Translate .gitlab-ci.yml into .gitea/workflows/ci.yml with the same coverage (client, lint, nox, server mysql + sqlite advisory, sidecar, image build, hadolint, sqlite boot smoke test). Images go to the Gitea registry as caelum and caelum-reduce. Sourcemaps upload straight to https://bugs.extant2000.com. Deploy copies the compose and runs deploy/gitea-deploy.sh on the box over SSH with a throwaway registry login, waits for healthy, and checks gitSha plus the .map exposure on the public edge. Repository links now point at git.extant2000.com. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
180 lines
7.0 KiB
YAML
180 lines
7.0 KiB
YAML
# Caelum: PRODUCTION stack for the OVH VPS (135.148.121.177).
|
|
#
|
|
# Unlike docker-compose.yml (local: builds from source, publishes a host port),
|
|
# this PULLS the prebuilt image from the Gitea registry (git.extant2000.com) and joins the
|
|
# external `web` Docker network so the edge Traefik can route caelum.network to
|
|
# the `caelum` container by service name on :3000.
|
|
#
|
|
# Routing + TLS are handled by a plain Traefik v3 (Docker-provider label
|
|
# routing + Let's Encrypt HTTP-01); see the `edge` stack on the box. The
|
|
# traefik.* labels on the caelum service below declare the router/cert. The app
|
|
# container exposes NO host port; it's only reachable inside the `web` network.
|
|
# The MySQL containers are on a private internal network only.
|
|
#
|
|
# Deploy: .gitea/workflows/ci.yml copies this file to /srv/prod/caelum and runs
|
|
# deploy/gitea-deploy.sh there over SSH (pull + up -d + health wait).
|
|
#
|
|
# Secrets live in ./caelum.env (gitignored; created on the VPS). See
|
|
# deploy/caelum.env.example for the template.
|
|
name: caelum
|
|
|
|
services:
|
|
caelum:
|
|
image: git.extant2000.com/extant2000/caelum:${CAELUM_TAG:-latest}
|
|
restart: unless-stopped
|
|
# VPS is linux/amd64; CI builds matching images. Fail loudly at create time
|
|
# on a wrong-arch image instead of crash-looping with "exec format error".
|
|
platform: linux/amd64
|
|
depends_on:
|
|
caelum-db:
|
|
condition: service_healthy
|
|
caelum-spacedb:
|
|
condition: service_healthy
|
|
env_file: [./caelum.env]
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: "3000"
|
|
HOST: "0.0.0.0"
|
|
# Written into .env by the deploy job. Surfaces at /api/health so a
|
|
# stale deploy is visible without reading pipeline history.
|
|
CAELUM_GIT_SHA: ${CAELUM_GIT_SHA:-}
|
|
networks: [web, internal]
|
|
deploy:
|
|
resources:
|
|
limits: { memory: 768M }
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then(r=>process.exit(r.status<500?0:1)).catch(()=>process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
start_period: 45s
|
|
retries: 5
|
|
logging:
|
|
driver: json-file
|
|
options: { max-size: "10m", max-file: "3" }
|
|
volumes:
|
|
# Persist user-uploaded archive files across image upgrades.
|
|
- caelum-uploads:/app/server/data/uploads
|
|
# Traefik edge routing (entrypoint `websecure` :443, cert resolver `le`).
|
|
# www→apex 301 happens in-app (server/src/index.js); Traefik just routes both.
|
|
labels:
|
|
- traefik.enable=true
|
|
- "traefik.http.routers.caelum.rule=Host(`caelum.network`) || Host(`www.caelum.network`)"
|
|
- traefik.http.routers.caelum.entrypoints=websecure
|
|
- traefik.http.routers.caelum.tls.certresolver=le
|
|
- traefik.http.services.caelum.loadbalancer.server.port=3000
|
|
|
|
# The reduction sidecar. Behind a profile and NOT started by the deploy job,
|
|
# because the pipeline is not production-ready yet: astrometry, extract and
|
|
# photometry have no implementation, so it would claim those stages and fail
|
|
# every one of them.
|
|
#
|
|
# docker compose --profile reduction up -d caelum-reduce
|
|
#
|
|
# The image is built by .gitea/workflows/ci.yml (caelum-reduce).
|
|
# The shared runner already builds one image per pipeline for nine repos, and
|
|
# adding a scientific-Python build on every push would cost more than a
|
|
# not-yet-usable service is worth. Add the job when the remaining stages land.
|
|
#
|
|
# Note what it does NOT need: the caelum-uploads volume. Frames and masters
|
|
# travel over HTTP through the worker endpoints, so the sidecar has no access
|
|
# to the archive on disk and can run on a different host entirely.
|
|
caelum-reduce:
|
|
profiles: ["reduction"]
|
|
# Nested path inside the caelum project's own registry. This previously
|
|
# named `paulhitt/caelum-reduce`, which is a SEPARATE PROJECT that does not
|
|
# exist, so the pull could only ever 404 and the reduction profile could
|
|
# never start. CI publishes this path (see sidecar-image-build).
|
|
image: git.extant2000.com/extant2000/caelum-reduce:${CAELUM_REDUCE_TAG:-latest}
|
|
restart: unless-stopped
|
|
platform: linux/amd64
|
|
depends_on:
|
|
caelum:
|
|
condition: service_healthy
|
|
env_file: [./caelum.env]
|
|
environment:
|
|
CAELUM_API_URL: http://caelum:3000
|
|
CAELUM_WORKER_ID: ovh-reduce
|
|
# Only the implemented stages. See the note above.
|
|
# Every stage the sidecar implements. This said `timing,calibrate` long
|
|
# after extract and photometry shipped, so a deployed worker would have
|
|
# left both unclaimed and the queue would never have drained past them.
|
|
CAELUM_WORKER_STAGES: timing,calibrate,extract,photometry
|
|
# internal only: it talks to the API over the compose network and needs no
|
|
# inbound route, so it gets no Traefik labels and no web network.
|
|
networks: [internal]
|
|
deploy:
|
|
resources:
|
|
limits: { memory: 1G }
|
|
logging:
|
|
driver: json-file
|
|
options: { max-size: "10m", max-file: "3" }
|
|
|
|
caelum-db:
|
|
image: mysql:8.4
|
|
restart: unless-stopped
|
|
env_file: [./caelum.env]
|
|
# 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
|
|
networks: [internal]
|
|
volumes:
|
|
- caelum-db:/var/lib/mysql
|
|
deploy:
|
|
resources:
|
|
limits: { memory: 768M }
|
|
healthcheck:
|
|
# $$ escapes compose interpolation so the literal var is read from the
|
|
# container env (injected by env_file), not from a compose .env file.
|
|
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p\"$$MYSQL_ROOT_PASSWORD\" --silent"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 30s
|
|
logging:
|
|
driver: json-file
|
|
options: { max-size: "10m", max-file: "3" }
|
|
|
|
# SpaceDB: the read-only NASA/JPL catalog (~1.5M asteroids/comets). Separate
|
|
# MySQL instance/volume from the app DB; the app connects via MYSQL_SPACEDB_*.
|
|
# Provisioned from its own env_file so MYSQL_DATABASE=caelum_spacedb doesn't
|
|
# collide with caelum-db's caelum_app. Data loaded from sql/spacedb.sql.
|
|
caelum-spacedb:
|
|
image: mysql:8.4
|
|
restart: unless-stopped
|
|
env_file: [./caelum-spacedb.env]
|
|
command: >
|
|
--character-set-server=utf8mb4
|
|
--collation-server=utf8mb4_unicode_ci
|
|
networks: [internal]
|
|
volumes:
|
|
- caelum-spacedb:/var/lib/mysql
|
|
deploy:
|
|
resources:
|
|
limits: { memory: 1024M }
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p\"$$MYSQL_ROOT_PASSWORD\" --silent"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 30s
|
|
logging:
|
|
driver: json-file
|
|
options: { max-size: "10m", max-file: "3" }
|
|
|
|
# The edge Traefik's `web` network already exists on the VPS, so join it, don't
|
|
# create it (`docker network create web` is part of edge setup).
|
|
# `internal` is private to this stack (app ↔ db); not exposed to other products.
|
|
networks:
|
|
web:
|
|
name: web
|
|
external: true
|
|
internal:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
caelum-db:
|
|
caelum-spacedb:
|
|
caelum-uploads:
|