albion/docker-compose.yml
Заид Омар Медхат 337dac78ba
All checks were successful
Deploy / deploy (push) Successful in 3m58s
Client/server split, Postgres, auth, Windows agent, Docker deploy
- Extract world-parse + packet capture into @albion/shared (reused by
  server and a new standalone agent workspace).
- Migrate the data layer from SQLite/better-sqlite3 to shared Postgres
  (async pg with a ?->$n helper; economy engine preloads the item/recipe
  graph so its sync recursion still works).
- API-key auth (ALBION_API_KEY) on all /api routes except health; web UI
  sends it via a fetch wrapper + key-entry gate; server serves the built
  UI with a path-traversal-safe static handler (drops @fastify/static).
- Windows companion agent: pushes world map + captured market orders to
  /api/ingest/*; runs on the gaming PC where the game traffic lives.
- Docker + docker-compose (external proxy + backend networks for Nginx
  Proxy Manager and shared Postgres) and a Forgejo deploy workflow.
- Validated end-to-end against Postgres 16 and a full compose run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-23 04:10:08 +05:00

38 lines
1.2 KiB
YAML

services:
albion:
build:
context: .
dockerfile: Dockerfile
image: albion-economy:latest
container_name: albion-economy
restart: unless-stopped
environment:
# Shared Postgres reachable on the internal `backend` network. Set the full
# URL in a .env file next to this compose, e.g.
# DATABASE_URL=postgres://albion:pw@postgres:5432/albion
DATABASE_URL: ${DATABASE_URL:?set DATABASE_URL in .env}
# REQUIRED for public deployment — the agent and web UI send this as a
# Bearer token. Set it in .env too.
ALBION_API_KEY: ${ALBION_API_KEY:?set ALBION_API_KEY in .env}
HOST: 0.0.0.0
PORT: "4310"
# Downloaded game-data JSON cache (not the DB) lives here.
ALBION_DATA_DIR: /data
volumes:
- albion_data:/data
networks:
- proxy # Nginx Proxy Manager terminates TLS + assigns the subdomain
- backend # shared Postgres lives here
# No host port publish: NPM reverse-proxies to albion:4310 on the proxy network.
# To run standalone without NPM, uncomment:
# ports:
# - "4310:4310"
volumes:
albion_data:
networks:
proxy:
external: true
backend:
external: true