-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (88 loc) · 3.19 KB
/
docker-compose.yml
File metadata and controls
97 lines (88 loc) · 3.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Infrastructure services for local development and integration testing.
#
# Functions run as local Node processes (via `make dev-fn` or `pnpm dev:fn`),
# NOT inside Docker. This keeps the edit-run cycle fast — no rebuild needed.
#
# Usage:
# docker compose up -d # Start infra (postgres, graphql, mailpit)
# docker compose down # Stop everything
# docker compose logs -f # Follow logs
services:
postgres:
image: ghcr.io/constructive-io/docker/postgres-plus:18
environment:
POSTGRES_DB: constructive
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set (see .env.example)}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
db-setup:
image: ghcr.io/constructive-io/constructive:latest
depends_on:
postgres:
condition: service_healthy
environment:
PGHOST: postgres
PGPORT: "5432"
PGUSER: postgres
PGPASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set (see .env.example)}
PGDATABASE: constructive
entrypoint: ["bash", "-c"]
command:
- |
cd /app
echo "Creating database $$PGDATABASE"
createdb -h "$$PGHOST" -U "$$PGUSER" "$$PGDATABASE" || true
echo "Applying bootstrap roles"
pgpm admin-users bootstrap --yes
pgpm admin-users add --test --yes
echo "Deploying packages"
pgpm deploy --yes --database "$$PGDATABASE" --package constructive
pgpm deploy --yes --database "$$PGDATABASE" --package constructive-services
pgpm deploy --yes --database "$$PGDATABASE" --package constructive-prod
echo "Deploying metaschema and jobs"
pgpm deploy --yes --database "$$PGDATABASE" --package metaschema
pgpm deploy --yes --database "$$PGDATABASE" --package pgpm-database-jobs
echo "Done"
graphql-server:
image: ghcr.io/constructive-io/constructive:latest
depends_on:
db-setup:
condition: service_completed_successfully
entrypoint: ["constructive", "server", "--host", "0.0.0.0", "--port", "3000", "--origin", "*"]
environment:
NODE_ENV: development
PORT: "3000"
SERVER_HOST: "0.0.0.0"
SERVER_TRUST_PROXY: "true"
SERVER_ORIGIN: "*"
SERVER_STRICT_AUTH: "false"
# Postgres connection
PGHOST: postgres
PGPORT: "5432"
PGUSER: postgres
PGPASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set (see .env.example)}
PGDATABASE: constructive
# API configuration — header-based routing (X-Api-Name, X-Database-Id)
API_ENABLE_SERVICES: "true"
API_EXPOSED_SCHEMAS: "metaschema_public,services_public,constructive_auth_public"
API_IS_PUBLIC: "false"
API_META_SCHEMAS: "metaschema_public,services_public,metaschema_modules_public,constructive_auth_public"
API_ANON_ROLE: "administrator"
API_ROLE_NAME: "administrator"
ports:
- "3002:3000"
mailpit:
image: axllent/mailpit:latest
ports:
- "1025:1025" # SMTP
- "8025:8025" # Web UI
volumes:
pgdata: