askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
danq9
signup: the person chooses the password and name on the confirm page
83c7aa6
2 weeks, 5 days ago
History
docker-compose.yml · 2.9 KB · 71 lines
| 1 | # DBBASIC Object Server — Docker Compose deployment. |
| 2 | # |
| 3 | # This is a second deployment path alongside the bare-VM systemd installer |
| 4 | # (scripts/install.sh, docs/single-vm-deployment.md). See |
| 5 | # docs/docker-deployment.md for the full walkthrough, including Coolify. |
| 6 | # |
| 7 | # The image built from ../Dockerfile is stateless: server code and the |
| 8 | # packages/ manifests ship inside it. All runtime state -- object source, |
| 9 | # TSV records, logs, versions, identity, permissions, the generated admin |
| 10 | # token -- lives on the two named volumes below, mounted at the same paths |
| 11 | # the Dockerfile sets as DBBASIC_OBJECTS_DIR / DBBASIC_DATA_DIR. That split |
| 12 | # is the entire point of this deployment shape: rebuilding and redeploying |
| 13 | # the image (a server *code* change) never touches the volumes, while live |
| 14 | # object/schema/package edits made through the admin HTTP API land on the |
| 15 | # volumes and take effect immediately, independent of the image lifecycle. |
| 16 | # |
| 17 | # TLS and domain routing are intentionally NOT part of this file. Coolify |
| 18 | # (or your own reverse proxy) terminates TLS and routes a public hostname to |
| 19 | # this container's published port, the same way Caddy sits in front of, not |
| 20 | # inside, the systemd unit in docs/single-vm-deployment.md. |
| 21 | |
| 22 | services: |
| 23 | object-server: |
| 24 | build: . |
| 25 | image: dbbasic-object-server |
| 26 | restart: unless-stopped |
| 27 | env_file: |
| 28 | # Git-ignored (see .gitignore). Copy .env.example to .env and fill in |
| 29 | # real values -- never commit .env itself. Marked optional so a fresh |
| 30 | # clone can `docker compose up --build` with zero setup: without a |
| 31 | # .env the server starts with its conservative built-in defaults and |
| 32 | # the entrypoint generates a first-boot admin token. |
| 33 | - path: .env |
| 34 | required: false |
| 35 | volumes: |
| 36 | - objects:/data/objects |
| 37 | - data:/data/state |
| 38 | ports: |
| 39 | # host:container -- change the host side if 8001 is already taken. |
| 40 | - "8001:8001" |
| 41 | healthcheck: |
| 42 | test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8001/health"] |
| 43 | interval: 30s |
| 44 | timeout: 5s |
| 45 | start_period: 10s |
| 46 | retries: 3 |
| 47 | |
| 48 | # OPTIONAL -- object_daemon.py runs the scheduler/queue/event background |
| 49 | # worker (see object_daemon.py, docs/runtime-contract.md). It is real, |
| 50 | # working code, but it is not wired into the bare-VM systemd installer |
| 51 | # either (see scripts/install.sh) -- nothing else in this repo depends on |
| 52 | # it running today. Uncomment only if you are using scheduled tasks, queue |
| 53 | # messages, or webhook event delivery and want them processed in the |
| 54 | # background. It shares the same volumes as object-server so it sees the |
| 55 | # same object source and runtime data. |
| 56 | # |
| 57 | # object-daemon: |
| 58 | # build: . |
| 59 | # image: dbbasic-object-server |
| 60 | # restart: unless-stopped |
| 61 | # env_file: |
| 62 | # - .env |
| 63 | # volumes: |
| 64 | # - objects:/data/objects |
| 65 | # - data:/data/state |
| 66 | # entrypoint: ["scripts/docker-entrypoint.sh"] |
| 67 | # command: ["python", "object_daemon.py"] |
| 68 | |
| 69 | volumes: |
| 70 | objects: |
| 71 | data: |