Files
OpenNest/compose.server.yaml
T
ajandClaude Opus 5.5 54ad7ee84d feat(server): nest Auto Nest jobs on the server's worker
Large nests tie up the workstation that runs them. In Database mode, Auto Nest
can now queue the job on the nest server, where a worker container solves one
job at a time under its own CPU and memory limits. The job has no time limit,
so a throttled worker finds the same nest a fast one does, only later.

- Server: /api/nest-jobs queue (schema v15). The worker holds a job on a
  heartbeat lease. When the lease lapses, the job goes back to the queue,
  or fails after three attempts. Only one job runs at a time. Packages and
  results are opaque to the HTTP server, which stays off Engine and IO.
- Worker: OpenNest.Server.Worker in the same image (OPENNEST_ROLE=worker),
  reaching the server over HTTP only. It records each engine answer with
  RecordingNestingEngine and gives its job back on shutdown.
- Desktop: "Nest on the server" in the Auto Nest dialog, for built-in
  engines only. The client replays the recorded answers with
  RemoteNestSubmission, so validation, the review and Keep run locally
  against the client's own drawings, exactly as after a local run. A
  drawing edited after sending refuses the result. If the server cannot
  take the job, the user may nest locally instead.
- compose.server.yaml adds the throttled worker service. The Dockerfile,
  .dockerignore, CI paths and the deploy script now include the worker's
  projects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 13:18:09 -05:00

48 lines
1.9 KiB
YAML

# OpenNest.Server deployment example: one instance, one local data volume, LAN-only.
# Usage: docker compose --env-file <local-env> -f compose.server.yaml up -d
# Start from OpenNest.Server/server.env.example. See docs/nest-storage.md before deploying.
name: opennest-server
services:
opennest-server:
image: ${OPENNEST_SERVER_IMAGE:?Set a tested version or digest}
restart: unless-stopped
ports:
- "${OPENNEST_BIND_ADDRESS:?Set 127.0.0.1 for testing or a trusted LAN address}:${OPENNEST_HOST_PORT:-8090}:8090"
environment:
ASPNETCORE_URLS: http://+:8090
OPENNEST_DB: /app/data/nests.db
# "off" stops mirroring the desktop update feed from GitHub (clients then check GitHub themselves).
OPENNEST_UPDATES: ${OPENNEST_UPDATES:-on}
volumes:
- opennest-data:/app/data
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
# Server nesting (docs/server-nesting.md): the same image solving queued Auto Nest jobs one
# at a time. It talks to the server over HTTP and never opens the database, and its own CPU
# and memory limits keep a large nest from slowing nest open and save. A job has no time
# limit, so fewer CPUs only make it slower, never a worse nest.
opennest-worker:
image: ${OPENNEST_SERVER_IMAGE:?Set a tested version or digest}
restart: unless-stopped
depends_on:
- opennest-server
environment:
OPENNEST_ROLE: worker
OPENNEST_SERVER_URL: http://opennest-server:8090/
cpus: ${OPENNEST_WORKER_CPUS:-2}
mem_limit: ${OPENNEST_WORKER_MEMORY:-4g}
# Time to give a running job back to the queue on stop.
stop_grace_period: 30s
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
volumes:
opennest-data:
# A restore switches to a separately verified volume instead of overwriting this one.
name: ${OPENNEST_DATA_VOLUME:-opennest-data}