|
| 1 | +# Production compose — registry mode. |
| 2 | +# |
| 3 | +# Mirrors docker-compose.prod.yml but pulls prebuilt images from GHCR |
| 4 | +# instead of building them on the deploy host. Pin BIDWRIGHT_TAG in |
| 5 | +# .env.server to a specific :sha-* tag for immutable releases; rolling |
| 6 | +# back is then a tag swap + `docker compose up -d`. |
| 7 | +# |
| 8 | +# The build-mode compose (docker-compose.prod.yml) is retained as a |
| 9 | +# documented fallback path. remote-deploy.sh selects between them via |
| 10 | +# the COMPOSE_FILE / DEPLOY_MODE variables. |
| 11 | + |
| 12 | +services: |
| 13 | + postgres: |
| 14 | + image: pgvector/pgvector:pg16 |
| 15 | + restart: unless-stopped |
| 16 | + environment: |
| 17 | + POSTGRES_USER: "${POSTGRES_USER:-bidwright}" |
| 18 | + POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-bidwright}" |
| 19 | + POSTGRES_DB: "${POSTGRES_DB:-bidwright}" |
| 20 | + volumes: |
| 21 | + - ${POSTGRES_DATA_PATH:-pgdata}:/var/lib/postgresql/data |
| 22 | + - ./scripts/db/init-pgvector.sql:/docker-entrypoint-initdb.d/01-pgvector.sql:ro |
| 23 | + healthcheck: |
| 24 | + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bidwright} -d ${POSTGRES_DB:-bidwright}"] |
| 25 | + interval: 5s |
| 26 | + timeout: 5s |
| 27 | + retries: 5 |
| 28 | + |
| 29 | + redis: |
| 30 | + image: redis:7-alpine |
| 31 | + restart: unless-stopped |
| 32 | + volumes: |
| 33 | + - ${REDIS_DATA_PATH:-redisdata}:/data |
| 34 | + healthcheck: |
| 35 | + test: ["CMD", "redis-cli", "ping"] |
| 36 | + interval: 5s |
| 37 | + timeout: 5s |
| 38 | + retries: 5 |
| 39 | + |
| 40 | + ollama: |
| 41 | + image: ollama/ollama |
| 42 | + profiles: |
| 43 | + - embeddings |
| 44 | + restart: unless-stopped |
| 45 | + volumes: |
| 46 | + - ${OLLAMA_DATA_PATH:-ollama_data}:/root/.ollama |
| 47 | + healthcheck: |
| 48 | + test: ["CMD-SHELL", "ollama list >/dev/null 2>&1 || exit 1"] |
| 49 | + interval: 10s |
| 50 | + timeout: 5s |
| 51 | + retries: 12 |
| 52 | + start_period: 30s |
| 53 | + |
| 54 | + ollama-init: |
| 55 | + image: curlimages/curl:latest |
| 56 | + profiles: |
| 57 | + - embeddings |
| 58 | + depends_on: |
| 59 | + ollama: |
| 60 | + condition: service_healthy |
| 61 | + restart: "no" |
| 62 | + entrypoint: > |
| 63 | + sh -c "curl -sf -X POST http://ollama:11434/api/pull -d '{\"name\":\"${EMBEDDING_MODEL:-snowflake-arctic-embed}\"}' && echo 'Model ready'" |
| 64 | +
|
| 65 | + # Runs Prisma db:push using the runtime API image (which carries the schema |
| 66 | + # and pnpm tooling because it COPYs the full /app from the builder stage). |
| 67 | + # No build target needed — we run the same image that powers the API service. |
| 68 | + db-migrate: |
| 69 | + image: "${BIDWRIGHT_REGISTRY:-ghcr.io/braedonsaunders}/bidwright-api:${BIDWRIGHT_TAG:-latest}" |
| 70 | + depends_on: |
| 71 | + postgres: |
| 72 | + condition: service_healthy |
| 73 | + environment: |
| 74 | + DATABASE_URL: "${DATABASE_URL:-postgresql://bidwright:bidwright@postgres:5432/bidwright}" |
| 75 | + restart: "no" |
| 76 | + command: ["pnpm", "--filter", "@bidwright/db", "db:push"] |
| 77 | + |
| 78 | + api: |
| 79 | + image: "${BIDWRIGHT_REGISTRY:-ghcr.io/braedonsaunders}/bidwright-api:${BIDWRIGHT_TAG:-latest}" |
| 80 | + restart: unless-stopped |
| 81 | + depends_on: |
| 82 | + postgres: |
| 83 | + condition: service_healthy |
| 84 | + redis: |
| 85 | + condition: service_healthy |
| 86 | + db-migrate: |
| 87 | + condition: service_completed_successfully |
| 88 | + environment: |
| 89 | + DATABASE_URL: "${DATABASE_URL:-postgresql://bidwright:bidwright@postgres:5432/bidwright}" |
| 90 | + REDIS_URL: "${REDIS_URL:-redis://redis:6379}" |
| 91 | + DATA_DIR: "${DATA_DIR:-/data}" |
| 92 | + API_PORT: "${API_PORT:-3001}" |
| 93 | + CLAUDE_CONFIG_DIR: "${CLAUDE_CONFIG_DIR:-/root/.claude}" |
| 94 | + CODEX_HOME: "${CODEX_HOME:-/root/.codex}" |
| 95 | + EMBEDDING_PROVIDER: "${EMBEDDING_PROVIDER:-local}" |
| 96 | + EMBEDDING_BASE_URL: "http://ollama:11434/v1" |
| 97 | + EMBEDDING_MODEL: "${EMBEDDING_MODEL:-snowflake-arctic-embed}" |
| 98 | + EMBEDDING_DIMENSIONS: "${EMBEDDING_DIMENSIONS:-1024}" |
| 99 | + OPENAI_API_KEY: "${OPENAI_API_KEY:-}" |
| 100 | + ANTHROPIC_API_KEY: "${ANTHROPIC_API_KEY:-}" |
| 101 | + OPENAI_MODEL: "${OPENAI_MODEL:-gpt-5}" |
| 102 | + volumes: |
| 103 | + - ${BIDWRIGHT_DATA_PATH:-./data/bidwright-api}:/data |
| 104 | + - ${CLAUDE_CONFIG_PATH:-/opt/bidwright/data/agent-home/claude}:/root/.claude |
| 105 | + - ${CODEX_HOME_PATH:-/opt/bidwright/data/agent-home/codex}:/root/.codex |
| 106 | + ports: |
| 107 | + - "${API_PUBLIC_PORT:-3001}:3001" |
| 108 | + healthcheck: |
| 109 | + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3001/health >/dev/null || exit 1"] |
| 110 | + interval: 10s |
| 111 | + timeout: 5s |
| 112 | + retries: 12 |
| 113 | + start_period: 20s |
| 114 | + |
| 115 | + web: |
| 116 | + image: "${BIDWRIGHT_REGISTRY:-ghcr.io/braedonsaunders}/bidwright-web:${BIDWRIGHT_TAG:-latest}" |
| 117 | + restart: unless-stopped |
| 118 | + depends_on: |
| 119 | + - api |
| 120 | + environment: |
| 121 | + NEXT_PUBLIC_API_BASE_URL: "${NEXT_PUBLIC_API_BASE_URL:-http://localhost:3001}" |
| 122 | + INTERNAL_API_BASE_URL: "http://api:3001" |
| 123 | + ports: |
| 124 | + - "${WEB_PUBLIC_PORT:-3000}:3000" |
| 125 | + healthcheck: |
| 126 | + test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:3000 >/dev/null || exit 1"] |
| 127 | + interval: 10s |
| 128 | + timeout: 5s |
| 129 | + retries: 12 |
| 130 | + start_period: 20s |
| 131 | + |
| 132 | + worker: |
| 133 | + image: "${BIDWRIGHT_REGISTRY:-ghcr.io/braedonsaunders}/bidwright-worker:${BIDWRIGHT_TAG:-latest}" |
| 134 | + restart: unless-stopped |
| 135 | + depends_on: |
| 136 | + postgres: |
| 137 | + condition: service_healthy |
| 138 | + redis: |
| 139 | + condition: service_healthy |
| 140 | + db-migrate: |
| 141 | + condition: service_completed_successfully |
| 142 | + environment: |
| 143 | + DATABASE_URL: "${DATABASE_URL:-postgresql://bidwright:bidwright@postgres:5432/bidwright}" |
| 144 | + REDIS_URL: "${REDIS_URL:-redis://redis:6379}" |
| 145 | + DATA_DIR: "${DATA_DIR:-/data}" |
| 146 | + API_PORT: "${API_PORT:-3001}" |
| 147 | + EMBEDDING_PROVIDER: "${EMBEDDING_PROVIDER:-local}" |
| 148 | + EMBEDDING_BASE_URL: "http://ollama:11434/v1" |
| 149 | + EMBEDDING_MODEL: "${EMBEDDING_MODEL:-snowflake-arctic-embed}" |
| 150 | + EMBEDDING_DIMENSIONS: "${EMBEDDING_DIMENSIONS:-1024}" |
| 151 | + OPENAI_API_KEY: "${OPENAI_API_KEY:-}" |
| 152 | + ANTHROPIC_API_KEY: "${ANTHROPIC_API_KEY:-}" |
| 153 | + volumes: |
| 154 | + - ${BIDWRIGHT_DATA_PATH:-./data/bidwright-api}:/data |
| 155 | + |
| 156 | +volumes: |
| 157 | + pgdata: |
| 158 | + redisdata: |
| 159 | + ollama_data: |
0 commit comments