Files
Anubis/docker-compose.yml
T
Alby96andClaude Opus 5.5 d00dfbd32f Add the guard that watches the engine and protects positions (refs #48)
The guard (SPEC 9.3, 9.4) is now the container's main process and the parent
of the engine. It listens on a named pipe for the engine's heartbeat and
startup steps, and steps in after two minutes of silence, ten minutes of a
startup that does not move, or an exit without notice. It stops the engine,
cancels our purchases and sales left open on demo accounts, puts back the
stops the positions need from the state file the engine writes every ten
seconds, writes a note, warns the user and restarts the engine without any
injected fault. The third forced restart within an hour writes the STOP
file. The container's stop is passed on to the engine, which closes in order.

At restart the engine adopts the guard's stops before reconciling, cancels
the orders it left open and plans again the exits already decided, so the
rules of SPEC 5.6 apply to them.

The acceptance test blocks the main loop right after a sale leaves: in
process on a demo-like broker, and with real processes in the drill, which
also runs inside the Docker image (tasks ci and the CI workflow). The guard
uses the ASP.NET shared runtime so both programs share /app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:36:32 +01:00

51 lines
1.6 KiB
YAML

# Development only (SPEC 3): the app plus a local PostgreSQL. Never used in production.
# Start: docker compose up --build Health: curl http://localhost:8787/health
# First access at http://localhost:8787 with ANUBIS_ADMIN_PASSWORD, then choose a new password.
services:
anubis:
build:
context: .
dockerfile: deploy/docker/Dockerfile
image: gitea.encke-hake.ts.net/balbosoft/anubis:dev
# The guard gives the engine up to 55 seconds to close in order (SPEC 9.3).
stop_grace_period: 60s
ports:
- "8787:8787"
environment:
ANUBIS_DB_ENGINE: postgres
ANUBIS_DB_HOST: postgres
ANUBIS_DB_PORT: "5432"
ANUBIS_DB_NAME: anubis
ANUBIS_DB_USER: anubis
ANUBIS_DB_PASSWORD: ${ANUBIS_DB_PASSWORD:-anubis-dev}
# Development values only: a real installation chooses its own (deploy/unraid/anubis.xml).
ANUBIS_SECRET_KEY: ${ANUBIS_SECRET_KEY:-dev-only-secret-key-change-me-0123456789}
ANUBIS_ADMIN_PASSWORD: ${ANUBIS_ADMIN_PASSWORD:-dev-only-change-me}
ANUBIS_ALLOW_LIVE: "0"
TZ: Europe/Rome
volumes:
- anubis-data:/data
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:18
environment:
POSTGRES_DB: anubis
POSTGRES_USER: anubis
POSTGRES_PASSWORD: ${ANUBIS_DB_PASSWORD:-anubis-dev}
ports:
- "127.0.0.1:55432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U anubis -d anubis"]
interval: 3s
timeout: 3s
retries: 20
volumes:
- postgres-data:/var/lib/postgresql
volumes:
anubis-data:
postgres-data: