Blame · Line-by-line history
docker-compose.standalone.yml
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| f635e2f | 1 | # Standalone single-box deploy: Gluecron + Postgres(pgvector) + Caddy(auto-HTTPS) |
| 2 | # plus self-healing (autoheal), log rotation, daily backups, and fast auto-deploy. | |
| 95e33b0 | 3 | # |
| 4 | # For a DEDICATED VPS where Gluecron owns ports 80/443 (no co-tenant). One | |
| 5 | # command brings up the whole stack with automatic Let's Encrypt certs: | |
| 6 | # | |
| 7 | # docker compose -f docker-compose.standalone.yml up -d --build | |
| 8 | # | |
| 9 | # Variables come from a local .env (POSTGRES_PASSWORD, optional ANTHROPIC_API_KEY) | |
| f635e2f | 10 | # — see scripts/standalone-deploy.sh which generates it and installs the backup |
| 11 | # + auto-deploy systemd timers. The Caddyfile already serves gluecron.com + www. | |
| 12 | ||
| 13 | x-logging: &default-logging | |
| 14 | driver: json-file | |
| 15 | options: | |
| 16 | max-size: "10m" | |
| 17 | max-file: "3" | |
| 18 | ||
| 95e33b0 | 19 | services: |
| 20 | postgres: | |
| 21 | # pgvector image is required: migration 0057 does CREATE EXTENSION vector. | |
| 22 | image: pgvector/pgvector:pg16 | |
| 23 | environment: | |
| 24 | POSTGRES_USER: gluecron | |
| 25 | POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | |
| 26 | POSTGRES_DB: gluecron | |
| 27 | volumes: | |
| 28 | - pgdata:/var/lib/postgresql/data | |
| 29 | restart: unless-stopped | |
| f635e2f | 30 | logging: *default-logging |
| 95e33b0 | 31 | healthcheck: |
| 32 | test: ["CMD-SHELL", "pg_isready -U gluecron -d gluecron"] | |
| 33 | interval: 10s | |
| 34 | timeout: 5s | |
| 35 | retries: 6 | |
| 36 | ||
| 37 | gluecron: | |
| 38 | build: . | |
| 95d0b72 | 39 | # Pass the ENTIRE .env into the container. Previously only a hardcoded |
| 40 | # allowlist below reached the app, so any env-gated feature whose var | |
| 41 | # wasn't hand-added here was silently dead even when set in .env — | |
| 42 | # SERVER_TARGETS_KEY (deploy targets), WORKFLOW_SECRETS_KEY (workflow | |
| 43 | # secrets), the VAPRON_* deploy vars, etc. env_file fixes the whole | |
| 44 | # class: set a documented var in .env and it just works. The explicit | |
| 45 | # `environment:` block below still wins for the literals it pins | |
| 46 | # (PORT, NODE_ENV, GIT_REPOS_PATH, APP_BASE_URL, SSH_PORT) and stays as | |
| 47 | # documentation of the load-bearing ones. | |
| 48 | env_file: | |
| 49 | - .env | |
| 95e33b0 | 50 | environment: |
| 09d5f39 | 51 | - DATABASE_URL=${DATABASE_URL:-} |
| 95e33b0 | 52 | - GIT_REPOS_PATH=/data/repos |
| 53 | - PORT=3000 | |
| 54 | - NODE_ENV=production | |
| 55 | - APP_BASE_URL=https://gluecron.com | |
| 56 | - SSH_PORT=0 | |
| 57 | - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-} | |
| 56ea9a9 | 58 | # "Sign in with Google" — values come from .env (gitignored). Wiring them |
| 59 | # here is what makes the env bootstrap reach the container and survive | |
| 60 | # redeploys; a config saved at /admin/google-oauth (DB) still takes | |
| 61 | # precedence over these. | |
| 62 | - GOOGLE_OAUTH_CLIENT_ID=${GOOGLE_OAUTH_CLIENT_ID:-} | |
| 63 | - GOOGLE_OAUTH_CLIENT_SECRET=${GOOGLE_OAUTH_CLIENT_SECRET:-} | |
| 64 | - GOOGLE_OAUTH_AUTO_CREATE=${GOOGLE_OAUTH_AUTO_CREATE:-} | |
| 65 | - GOOGLE_OAUTH_ALLOWED_DOMAINS=${GOOGLE_OAUTH_ALLOWED_DOMAINS:-} | |
| 95e33b0 | 66 | expose: |
| 67 | - "3000" | |
| 68 | volumes: | |
| 69 | - git-repos:/data/repos | |
| 70 | depends_on: | |
| 71 | postgres: | |
| 72 | condition: service_healthy | |
| 73 | restart: unless-stopped | |
| f635e2f | 74 | logging: *default-logging |
| 95e33b0 | 75 | healthcheck: |
| f635e2f | 76 | # Liveness — autoheal restarts the container if this fails repeatedly. |
| 95e33b0 | 77 | test: ["CMD", "wget", "-qO-", "http://localhost:3000/healthz"] |
| 78 | interval: 30s | |
| 79 | timeout: 10s | |
| 80 | retries: 3 | |
| f635e2f | 81 | start_period: 60s |
| 95e33b0 | 82 | |
| 83 | caddy: | |
| 84 | image: caddy:2-alpine | |
| 85 | restart: unless-stopped | |
| f635e2f | 86 | logging: *default-logging |
| 95e33b0 | 87 | ports: |
| 88 | - "80:80" | |
| 89 | - "443:443" | |
| 90 | volumes: | |
| 91 | - ./Caddyfile:/etc/caddy/Caddyfile:ro | |
| 92 | - caddy-data:/data | |
| 93 | - caddy-config:/config | |
| 94 | depends_on: | |
| 95 | - gluecron | |
| 96 | ||
| f635e2f | 97 | # Self-healing: watches every container that declares a healthcheck and |
| 98 | # restarts any that goes unhealthy (a hung process that didn't crash). | |
| 99 | autoheal: | |
| 100 | image: willfarrell/autoheal:latest | |
| 101 | restart: unless-stopped | |
| 102 | logging: *default-logging | |
| 103 | environment: | |
| 104 | - AUTOHEAL_CONTAINER_LABEL=all | |
| 105 | - AUTOHEAL_INTERVAL=15 | |
| 106 | - AUTOHEAL_START_PERIOD=60 | |
| 107 | volumes: | |
| 108 | - /var/run/docker.sock:/var/run/docker.sock | |
| 109 | ||
| 95e33b0 | 110 | volumes: |
| 111 | pgdata: | |
| 112 | git-repos: | |
| 113 | caddy-data: | |
| 114 | caddy-config: |