@omnibase/cli 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +3 -7
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/db.d.ts.map +1 -1
- package/dist/commands/db.js +113 -87
- package/dist/commands/db.js.map +1 -1
- package/dist/commands/email.d.ts.map +1 -1
- package/dist/commands/email.js +44 -53
- package/dist/commands/email.js.map +1 -1
- package/dist/commands/permissions.d.ts +0 -1
- package/dist/commands/permissions.d.ts.map +1 -1
- package/dist/commands/permissions.js +7 -15
- package/dist/commands/permissions.js.map +1 -1
- package/dist/commands/restart.d.ts.map +1 -1
- package/dist/commands/restart.js +4 -53
- package/dist/commands/restart.js.map +1 -1
- package/dist/commands/stripe.d.ts.map +1 -1
- package/dist/commands/stripe.js +418 -171
- package/dist/commands/stripe.js.map +1 -1
- package/dist/index.js +11 -32
- package/dist/index.js.map +1 -1
- package/dist/utils/api-client.d.ts +3 -2
- package/dist/utils/api-client.d.ts.map +1 -1
- package/dist/utils/api-client.js +7 -8
- package/dist/utils/api-client.js.map +1 -1
- package/dist/utils/context.d.ts +3 -2
- package/dist/utils/context.d.ts.map +1 -1
- package/dist/utils/context.js.map +1 -1
- package/dist/utils/docker.d.ts +27 -0
- package/dist/utils/docker.d.ts.map +1 -0
- package/dist/utils/docker.js +126 -0
- package/dist/utils/docker.js.map +1 -0
- package/docker/db/000000_users.up.sql +29 -0
- package/docker/db/000012_stripe_webhooks.up.sql +21 -0
- package/docker/db/000013_stripe_webhooks_connect.up.sql +5 -0
- package/docker/db/000014_add_enterprise_pricing.up.sql +11 -0
- package/docker/{docker-compose.yml → docker-compose.base.yml} +96 -35
- package/docker/docker-compose.dev.yml +8 -253
- package/docker/docker-compose.local.yml +15 -0
- package/docker/docker-compose.perf-test.yml +58 -0
- package/docker/docker-compose.test.yml +43 -0
- package/docker/pgbouncer/pgbouncer.ini +51 -0
- package/package.json +8 -3
- package/templates/environments/.env.local +0 -1
- package/templates/permissions/tenants.ts +13 -5
- package/templates/{payments → stripe}/example.config.json +14 -0
- package/dist/commands/workers.d.ts +0 -3
- package/dist/commands/workers.d.ts.map +0 -1
- package/dist/commands/workers.js +0 -133
- package/dist/commands/workers.js.map +0 -1
- package/docker/permissions/namespaces/2025-12-11T03:42:51.799Z-permissions.ts +0 -101
|
@@ -2,18 +2,63 @@ services:
|
|
|
2
2
|
# PostgreSQL Database
|
|
3
3
|
postgres:
|
|
4
4
|
image: postgres:17-alpine
|
|
5
|
+
# Increase max_connections for stress testing (default is 100)
|
|
6
|
+
command: postgres -c max_connections=300
|
|
5
7
|
environment:
|
|
6
8
|
POSTGRES_DB: db
|
|
7
9
|
POSTGRES_USER: postgres
|
|
8
10
|
POSTGRES_PASSWORD: postgres
|
|
9
11
|
ports:
|
|
10
12
|
- "5432:5432"
|
|
13
|
+
networks:
|
|
14
|
+
- app-network
|
|
15
|
+
restart: unless-stopped
|
|
16
|
+
healthcheck:
|
|
17
|
+
test: ["CMD-SHELL", "pg_isready -U postgres -d db"]
|
|
18
|
+
interval: 2s
|
|
19
|
+
timeout: 5s
|
|
20
|
+
retries: 10
|
|
21
|
+
start_period: 5s
|
|
22
|
+
|
|
23
|
+
# PgBouncer - Connection Pooler
|
|
24
|
+
pgbouncer:
|
|
25
|
+
image: edoburu/pgbouncer:latest
|
|
26
|
+
ports:
|
|
27
|
+
- "6432:6432"
|
|
28
|
+
environment:
|
|
29
|
+
DATABASE_URL: postgres://postgres:postgres@postgres:5432/db
|
|
30
|
+
AUTH_TYPE: scram-sha-256
|
|
11
31
|
volumes:
|
|
12
|
-
-
|
|
13
|
-
|
|
32
|
+
- ./pgbouncer/pgbouncer.ini:/etc/pgbouncer/pgbouncer.ini:ro
|
|
33
|
+
depends_on:
|
|
34
|
+
postgres:
|
|
35
|
+
condition: service_healthy
|
|
14
36
|
networks:
|
|
15
37
|
- app-network
|
|
16
38
|
restart: unless-stopped
|
|
39
|
+
healthcheck:
|
|
40
|
+
test: ["CMD-SHELL", "pg_isready -h localhost -p 6432 -U postgres"]
|
|
41
|
+
interval: 2s
|
|
42
|
+
timeout: 5s
|
|
43
|
+
retries: 10
|
|
44
|
+
|
|
45
|
+
db-migrate:
|
|
46
|
+
image: migrate/migrate:latest
|
|
47
|
+
volumes:
|
|
48
|
+
- ./db:/migrations
|
|
49
|
+
command:
|
|
50
|
+
[
|
|
51
|
+
"-path",
|
|
52
|
+
"/migrations",
|
|
53
|
+
"-database",
|
|
54
|
+
"postgres://postgres:postgres@postgres:5432/db?sslmode=disable&x-migrations-table=migrations.init_migrations",
|
|
55
|
+
"up",
|
|
56
|
+
]
|
|
57
|
+
networks:
|
|
58
|
+
- app-network
|
|
59
|
+
depends_on:
|
|
60
|
+
postgres:
|
|
61
|
+
condition: service_healthy
|
|
17
62
|
|
|
18
63
|
auth-migrate:
|
|
19
64
|
image: phoenixsolutionsgroup/omnibase-auth:v0.1.2
|
|
@@ -28,26 +73,26 @@ services:
|
|
|
28
73
|
networks:
|
|
29
74
|
- app-network
|
|
30
75
|
depends_on:
|
|
31
|
-
-
|
|
32
|
-
|
|
76
|
+
db-migrate:
|
|
77
|
+
condition: service_completed_successfully
|
|
78
|
+
rest-api:
|
|
79
|
+
condition: service_started
|
|
33
80
|
auth:
|
|
34
81
|
depends_on:
|
|
35
82
|
- auth-migrate
|
|
36
83
|
- rest-api
|
|
84
|
+
- pgbouncer
|
|
37
85
|
image: phoenixsolutionsgroup/omnibase-auth:v0.1.2
|
|
38
|
-
ports:
|
|
39
|
-
- "4433:4433" # public
|
|
40
|
-
- "4434:4434" # admin
|
|
41
86
|
restart: unless-stopped
|
|
42
87
|
env_file:
|
|
43
88
|
- ${OMNIBASE_ENV_FILE}
|
|
44
89
|
environment:
|
|
45
|
-
- DSN=postgres://
|
|
90
|
+
- DSN=postgres://auth:auth@pgbouncer:6432/db?sslmode=disable&max_conns=20&max_idle_conns=4
|
|
46
91
|
|
|
47
92
|
# Required - will fail if not set
|
|
48
|
-
- WEBSITE_URL=${WEBSITE_URL}
|
|
49
|
-
- COOKIE_SECRET=${COOKIE_SECRET}
|
|
50
|
-
- CIPHER_SECRET=${CIPHER_SECRET}
|
|
93
|
+
- WEBSITE_URL=${WEBSITE_URL:-http://127.0.0.1:3000}
|
|
94
|
+
- COOKIE_SECRET=${COOKIE_SECRET:-PLEASE-CHANGE-ME-I-AM-VERY-INSECURE}
|
|
95
|
+
- CIPHER_SECRET=${CIPHER_SECRET:-32-LONG-SECRET-NOT-SECURE-AT-ALL}
|
|
51
96
|
- COOKIE_DOMAIN=${COOKIE_DOMAIN:-127.0.0.1}
|
|
52
97
|
|
|
53
98
|
# Optional with defaults
|
|
@@ -68,6 +113,8 @@ services:
|
|
|
68
113
|
|
|
69
114
|
- AUTH_JWT_JWKS=${AUTH_JWT_JWKS-{}}
|
|
70
115
|
- API_URL=http://rest-api:8080
|
|
116
|
+
- API_PUBLIC_URL=${API_PUBLIC_URL:-http://127.0.0.1:8080}
|
|
117
|
+
- SERVICE_KEY=VERY_SECRET_KEY
|
|
71
118
|
- WAIT_FOR_API_HEALTH=true
|
|
72
119
|
- APP_NAME=${APP_NAME:-"My App"}
|
|
73
120
|
entrypoint: ["/bin/sh", "/usr/local/bin/entrypoint.sh"]
|
|
@@ -92,14 +139,12 @@ services:
|
|
|
92
139
|
minio:
|
|
93
140
|
image: minio/minio:latest
|
|
94
141
|
ports:
|
|
95
|
-
- "9000:9000"
|
|
96
|
-
- "9001:9001"
|
|
142
|
+
- "9000:9000" # API
|
|
143
|
+
- "9001:9001" # Console
|
|
97
144
|
environment:
|
|
98
145
|
MINIO_ROOT_USER: minioadmin
|
|
99
146
|
MINIO_ROOT_PASSWORD: minioadmin123
|
|
100
147
|
MINIO_API_CORS_ALLOW_ORIGIN: "*"
|
|
101
|
-
volumes:
|
|
102
|
-
- minio_data:/data
|
|
103
148
|
command: server /data --console-address ":9001"
|
|
104
149
|
networks:
|
|
105
150
|
- app-network
|
|
@@ -127,7 +172,8 @@ services:
|
|
|
127
172
|
ports:
|
|
128
173
|
- "8081:8080"
|
|
129
174
|
depends_on:
|
|
130
|
-
-
|
|
175
|
+
db-migrate:
|
|
176
|
+
condition: service_completed_successfully
|
|
131
177
|
networks:
|
|
132
178
|
- app-network
|
|
133
179
|
restart: unless-stopped
|
|
@@ -138,13 +184,16 @@ services:
|
|
|
138
184
|
ports:
|
|
139
185
|
- "8001:3000"
|
|
140
186
|
environment:
|
|
141
|
-
PGRST_DB_URI: postgres://postgres:postgres@
|
|
187
|
+
PGRST_DB_URI: postgres://postgres:postgres@pgbouncer:6432/db
|
|
142
188
|
PGRST_DB_SCHEMAS: public,auth,storage
|
|
143
189
|
PGRST_DB_ANON_ROLE: anon_user
|
|
144
190
|
PGRST_JWT_SECRET: ${JWT_SIGNING_KEY:-your-secret-jwt-signing-key-change-this-in-production}
|
|
145
191
|
PGRST_OPENAPI_SERVER_PROXY_URI: http://localhost:8001
|
|
146
192
|
depends_on:
|
|
147
|
-
-
|
|
193
|
+
db-migrate:
|
|
194
|
+
condition: service_completed_successfully
|
|
195
|
+
pgbouncer:
|
|
196
|
+
condition: service_healthy
|
|
148
197
|
networks:
|
|
149
198
|
- app-network
|
|
150
199
|
restart: unless-stopped
|
|
@@ -155,7 +204,10 @@ services:
|
|
|
155
204
|
ports:
|
|
156
205
|
- "8080:8080"
|
|
157
206
|
depends_on:
|
|
158
|
-
-
|
|
207
|
+
db-migrate:
|
|
208
|
+
condition: service_completed_successfully
|
|
209
|
+
pgbouncer:
|
|
210
|
+
condition: service_healthy
|
|
159
211
|
networks:
|
|
160
212
|
- app-network
|
|
161
213
|
restart: unless-stopped
|
|
@@ -165,9 +217,9 @@ services:
|
|
|
165
217
|
- AUTH_URL=http://auth:4433
|
|
166
218
|
- AUTH_ADMIN_URL=http://auth:4434
|
|
167
219
|
|
|
168
|
-
# Database
|
|
169
|
-
- DB_HOST=
|
|
170
|
-
- DB_PORT=
|
|
220
|
+
# Database (via pgbouncer)
|
|
221
|
+
- DB_HOST=pgbouncer
|
|
222
|
+
- DB_PORT=6432
|
|
171
223
|
- DB_USER=postgres
|
|
172
224
|
- DB_PASSWORD=postgres
|
|
173
225
|
- DB_NAME=db
|
|
@@ -217,18 +269,19 @@ services:
|
|
|
217
269
|
networks:
|
|
218
270
|
- app-network
|
|
219
271
|
depends_on:
|
|
220
|
-
-
|
|
272
|
+
db-migrate:
|
|
273
|
+
condition: service_completed_successfully
|
|
274
|
+
rest-api:
|
|
275
|
+
condition: service_started
|
|
221
276
|
|
|
222
277
|
permissions:
|
|
223
278
|
depends_on:
|
|
224
279
|
- permissions-migrate
|
|
280
|
+
- pgbouncer
|
|
225
281
|
image: phoenixsolutionsgroup/omnibase-permissions:v0.1.1
|
|
226
|
-
ports:
|
|
227
|
-
- "4466:4466" # read API
|
|
228
|
-
- "4467:4467" # write API
|
|
229
282
|
restart: unless-stopped
|
|
230
283
|
environment:
|
|
231
|
-
- DSN=postgres://
|
|
284
|
+
- DSN=postgres://permissions:permissions@pgbouncer:6432/db?sslmode=disable&max_conns=20&max_idle_conns=4
|
|
232
285
|
- LOG_LEVEL=debug
|
|
233
286
|
- NAMESPACE_BUCKET=dev
|
|
234
287
|
- R2_ENDPOINT=http://minio:9000
|
|
@@ -241,8 +294,6 @@ services:
|
|
|
241
294
|
|
|
242
295
|
postgres-type-gen:
|
|
243
296
|
image: supabase/postgres-meta:canary-pr-971
|
|
244
|
-
ports:
|
|
245
|
-
- 8079:8080
|
|
246
297
|
environment:
|
|
247
298
|
- PG_META_DB_HOST=postgres
|
|
248
299
|
- PG_META_DB_NAME=db
|
|
@@ -250,15 +301,25 @@ services:
|
|
|
250
301
|
- PG_META_DB_PASSWORD=postgres
|
|
251
302
|
- PG_META_DB_PORT=5432
|
|
252
303
|
depends_on:
|
|
253
|
-
-
|
|
304
|
+
db-migrate:
|
|
305
|
+
condition: service_completed_successfully
|
|
254
306
|
networks:
|
|
255
307
|
- app-network
|
|
256
308
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
309
|
+
# Workers - Hono app for background jobs
|
|
310
|
+
workers:
|
|
311
|
+
image: oven/bun:latest
|
|
312
|
+
working_dir: /app
|
|
313
|
+
volumes:
|
|
314
|
+
- ${OMNIBASE_PROJECT_DIR}/omnibase/workers:/app
|
|
315
|
+
ports:
|
|
316
|
+
- "8787:8787"
|
|
317
|
+
environment:
|
|
318
|
+
- PORT=8787
|
|
319
|
+
command: sh -c "bun install && bun run dev"
|
|
320
|
+
networks:
|
|
321
|
+
- app-network
|
|
322
|
+
restart: unless-stopped
|
|
262
323
|
|
|
263
324
|
networks:
|
|
264
325
|
app-network:
|
|
@@ -1,288 +1,43 @@
|
|
|
1
|
+
# Development overrides - local builds with hot-reload
|
|
1
2
|
services:
|
|
2
|
-
# PostgreSQL Database
|
|
3
|
-
postgres:
|
|
4
|
-
image: postgres:17-alpine
|
|
5
|
-
environment:
|
|
6
|
-
POSTGRES_DB: db
|
|
7
|
-
POSTGRES_USER: postgres
|
|
8
|
-
POSTGRES_PASSWORD: postgres
|
|
9
|
-
ports:
|
|
10
|
-
- "5432:5432"
|
|
11
|
-
volumes:
|
|
12
|
-
# - postgres_data:/var/lib/pos/tgresql/data
|
|
13
|
-
- ./db:/docker-entrypoint-initdb.d
|
|
14
|
-
networks:
|
|
15
|
-
- app-network
|
|
16
|
-
restart: unless-stopped
|
|
17
|
-
|
|
18
3
|
auth-migrate:
|
|
4
|
+
image: ""
|
|
19
5
|
build:
|
|
20
6
|
context: ../../../docker/auth
|
|
21
7
|
dockerfile: Dockerfile
|
|
22
|
-
environment:
|
|
23
|
-
- DSN=postgres://postgres:postgres@postgres:5432/db?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=auth
|
|
24
|
-
- IDENTITY_SCHEMA_URL=http://rest-api:8080/api/v1/auth/identity-schema
|
|
25
|
-
- AUTH_JWT_JWKS=${AUTH_JWT_JWKS-{}}
|
|
26
|
-
- WAIT_FOR_API_HEALTH=true
|
|
27
|
-
- API_URL=http://rest-api:8080
|
|
28
|
-
|
|
29
8
|
volumes:
|
|
30
9
|
- type: bind
|
|
31
10
|
source: ../../../docker/auth
|
|
32
11
|
target: /etc/config/auth
|
|
33
|
-
command: migrate sql -e --yes
|
|
34
|
-
restart: on-failure
|
|
35
|
-
networks:
|
|
36
|
-
- app-network
|
|
37
|
-
depends_on:
|
|
38
|
-
- postgres
|
|
39
|
-
- rest-api
|
|
40
12
|
|
|
41
13
|
auth:
|
|
42
|
-
|
|
43
|
-
- auth-migrate
|
|
44
|
-
- rest-api
|
|
14
|
+
image: ""
|
|
45
15
|
build:
|
|
46
16
|
context: ../../../docker/auth
|
|
47
17
|
dockerfile: Dockerfile
|
|
48
|
-
env_file:
|
|
49
|
-
- ${OMNIBASE_ENV_FILE}
|
|
50
|
-
ports:
|
|
51
|
-
- "4433:4433" # public
|
|
52
|
-
- "4434:4434" # admin
|
|
53
|
-
restart: unless-stopped
|
|
54
|
-
environment:
|
|
55
|
-
- DSN=postgres://postgres:postgres@postgres:5432/db?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=auth
|
|
56
|
-
- IDENTITY_SCHEMA_URL=http://rest-api:8080/api/v1/auth/identity-schema
|
|
57
|
-
|
|
58
|
-
# Required - will fail if not set
|
|
59
|
-
- WEBSITE_URL=${WEBSITE_URL}
|
|
60
|
-
- COOKIE_SECRET=${COOKIE_SECRET}
|
|
61
|
-
- CIPHER_SECRET=${CIPHER_SECRET}
|
|
62
|
-
- COOKIE_DOMAIN=${COOKIE_DOMAIN:-127.0.0.1}
|
|
63
|
-
|
|
64
|
-
# Optional with defaults
|
|
65
|
-
- LOG_LEVEL=${AUTH_LOG_LEVEL:-info}
|
|
66
|
-
- AUTH_URL=${AUTH_URL:-http://127.0.0.1:4433}
|
|
67
|
-
- AUTH_ADMIN_URL=${AUTH_ADMIN_URL:-http://auth:4434}
|
|
68
|
-
|
|
69
|
-
- WEBSITE_AUTH_ERROR_URL=${WEBSITE_AUTH_ERROR_URL:-${WEBSITE_URL}/auth/error}
|
|
70
|
-
- WEBSITE_SETTING_URL=${WEBSITE_SETTING_URL:-${WEBSITE_URL}/auth/settings}
|
|
71
|
-
- WEBSITE_RECOVERY_URL=${WEBSITE_RECOVERY_URL:-${WEBSITE_URL}/auth/recovery}
|
|
72
|
-
- WEBSITE_VERIFICATION_RECOVERY_URL=${WEBSITE_VERIFICATION_RECOVERY_URL:-${WEBSITE_URL}/auth/verification}
|
|
73
|
-
- WEBSITE_LOGIN_URL=${WEBSITE_LOGIN_URL:-${WEBSITE_URL}/auth/login}
|
|
74
|
-
- WEBSITE_REGISTRATION_URL=${WEBSITE_REGISTRATION_URL:-${WEBSITE_URL}/auth/registration}
|
|
75
|
-
|
|
76
|
-
- SMTP_CONNECTION_URI=${SMTP_CONNECTION_URI:-smtp://mailpit:1025?disable_starttls=true}
|
|
77
|
-
- SMTP_FROM_ADDRESS=${SMTP_FROM_ADDRESS:-no-reply@omnibase.tech}
|
|
78
|
-
- SMTP_FROM_NAME=${SMTP_FROM_NAME:-"Omnibase Auth"}
|
|
79
|
-
|
|
80
|
-
- AUTH_JWT_JWKS=${AUTH_JWT_JWKS-{}}
|
|
81
|
-
- API_URL=http://rest-api:8080
|
|
82
|
-
- SERVICE_KEY=VERY_SECRET_KEY
|
|
83
|
-
- WAIT_FOR_API_HEALTH=true
|
|
84
|
-
- APP_NAME=${APP_NAME:-"My App"}
|
|
85
18
|
volumes:
|
|
86
19
|
- type: bind
|
|
87
20
|
source: ../../../docker/auth
|
|
88
21
|
target: /etc/config/auth
|
|
89
|
-
command: serve --dev --watch-courier
|
|
90
|
-
networks:
|
|
91
|
-
- app-network
|
|
92
22
|
|
|
93
|
-
mailpit:
|
|
94
|
-
image: axllent/mailpit:latest
|
|
95
|
-
ports:
|
|
96
|
-
- "8025:8025" # Web UI
|
|
97
|
-
- "1025:1025" # SMTP server
|
|
98
|
-
environment:
|
|
99
|
-
MP_MAX_MESSAGES: 5000
|
|
100
|
-
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
|
101
|
-
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
|
102
|
-
networks:
|
|
103
|
-
- app-network
|
|
104
|
-
restart: unless-stopped
|
|
105
|
-
|
|
106
|
-
# MinIO - Object Storage
|
|
107
|
-
minio:
|
|
108
|
-
image: minio/minio:latest
|
|
109
|
-
ports:
|
|
110
|
-
- "9000:9000"
|
|
111
|
-
- "9001:9001"
|
|
112
|
-
environment:
|
|
113
|
-
MINIO_ROOT_USER: minioadmin
|
|
114
|
-
MINIO_ROOT_PASSWORD: minioadmin123
|
|
115
|
-
MINIO_API_CORS_ALLOW_ORIGIN: "*"
|
|
116
|
-
volumes:
|
|
117
|
-
- minio_data:/data
|
|
118
|
-
command: server /data --console-address ":9001"
|
|
119
|
-
networks:
|
|
120
|
-
- app-network
|
|
121
|
-
restart: unless-stopped
|
|
122
|
-
# Create MinIO bucket on startup
|
|
123
|
-
minio-init:
|
|
124
|
-
image: minio/mc:latest
|
|
125
|
-
depends_on:
|
|
126
|
-
- minio
|
|
127
|
-
entrypoint: >
|
|
128
|
-
/bin/sh -c "
|
|
129
|
-
until /usr/bin/mc alias set myminio http://minio:9000 minioadmin minioadmin123; do
|
|
130
|
-
echo 'Waiting for MinIO to be ready...';
|
|
131
|
-
sleep 2;
|
|
132
|
-
done;
|
|
133
|
-
/usr/bin/mc mb myminio/dev --ignore-existing;
|
|
134
|
-
echo 'MinIO buckets created successfully';
|
|
135
|
-
"
|
|
136
|
-
networks:
|
|
137
|
-
- app-network
|
|
138
|
-
|
|
139
|
-
# Adminer - Simple Database Management Interface
|
|
140
|
-
adminer:
|
|
141
|
-
image: adminer:latest
|
|
142
|
-
ports:
|
|
143
|
-
- "8081:8080"
|
|
144
|
-
depends_on:
|
|
145
|
-
- postgres
|
|
146
|
-
networks:
|
|
147
|
-
- app-network
|
|
148
|
-
restart: unless-stopped
|
|
149
|
-
|
|
150
|
-
# PostgREST - Auto-generated REST API from PostgreSQL schema
|
|
151
|
-
postgrest:
|
|
152
|
-
image: postgrest/postgrest:v12.2.0
|
|
153
|
-
ports:
|
|
154
|
-
- "8001:3000"
|
|
155
|
-
environment:
|
|
156
|
-
PGRST_DB_URI: postgres://postgres:postgres@postgres:5432/db
|
|
157
|
-
PGRST_DB_SCHEMAS: public,auth,storage
|
|
158
|
-
PGRST_DB_ANON_ROLE: anon_user
|
|
159
|
-
PGRST_JWT_SECRET: ${JWT_SIGNING_KEY:-your-secret-jwt-signing-key-change-this-in-production}
|
|
160
|
-
PGRST_OPENAPI_SERVER_PROXY_URI: http://localhost:8001
|
|
161
|
-
depends_on:
|
|
162
|
-
- postgres
|
|
163
|
-
networks:
|
|
164
|
-
- app-network
|
|
165
|
-
restart: unless-stopped
|
|
166
|
-
|
|
167
|
-
# REST API Service
|
|
168
23
|
rest-api:
|
|
24
|
+
image: ""
|
|
169
25
|
build:
|
|
170
26
|
context: ../../../apps/api
|
|
171
27
|
dockerfile: Dockerfile.dev
|
|
172
|
-
|
|
173
|
-
-
|
|
28
|
+
environment:
|
|
29
|
+
- ENABLE_PPROF=true
|
|
174
30
|
volumes:
|
|
175
31
|
- ../../../apps/api:/app
|
|
176
|
-
depends_on:
|
|
177
|
-
- postgres
|
|
178
|
-
networks:
|
|
179
|
-
- app-network
|
|
180
|
-
restart: unless-stopped
|
|
181
|
-
environment:
|
|
182
|
-
# Application
|
|
183
|
-
- PORT=8080
|
|
184
|
-
- AUTH_URL=http://auth:4433
|
|
185
|
-
- AUTH_ADMIN_URL=http://auth:4434
|
|
186
|
-
|
|
187
|
-
# Database
|
|
188
|
-
- DB_HOST=postgres
|
|
189
|
-
- DB_PORT=5432
|
|
190
|
-
- DB_USER=postgres
|
|
191
|
-
- DB_PASSWORD=postgres
|
|
192
|
-
- DB_NAME=db
|
|
193
|
-
|
|
194
|
-
# S3/MinIO Configuration
|
|
195
|
-
- S3_ENDPOINT=http://minio:9000
|
|
196
|
-
- S3_PUBLIC_ENDPOINT=http://127.0.0.1:9000
|
|
197
|
-
- S3_ACCESS_KEY=minioadmin
|
|
198
|
-
- S3_SECRET_KEY=minioadmin123
|
|
199
|
-
- S3_BUCKET_NAME=files
|
|
200
|
-
- S3_REGION=us-east-1
|
|
201
|
-
- S3_USE_SSL=false
|
|
202
|
-
- S3_FORCE_PATH_STYLE=true
|
|
203
|
-
- S3_BUCKET_NAME=dev
|
|
204
|
-
|
|
205
|
-
# Email Configuration
|
|
206
|
-
- SMTP_CONNECTION_URI=smtp://mailpit:1025
|
|
207
|
-
- SMTP_FROM_EMAIL=noreply@yourapp.com
|
|
208
|
-
- FRONTEND_URL=http://localhost:3000
|
|
209
|
-
|
|
210
|
-
# JWT Configuration
|
|
211
|
-
- JWT_SIGNING_KEY=${JWT_SIGNING_KEY:-your-secret-jwt-signing-key-change-this-in-production}
|
|
212
|
-
- JWT_SECRET=${JWT_SECRET:-VERY_SECRET_KEY}
|
|
213
|
-
|
|
214
|
-
# Permissions Configuration
|
|
215
|
-
- PERMISSIONS_READ_URL=http://permissions:4466
|
|
216
|
-
- PERMISSIONS_WRITE_URL=http://permissions:4467
|
|
217
|
-
|
|
218
|
-
# PostgREST Configuration
|
|
219
|
-
- POSTGREST_URL=http://postgrest:3000
|
|
220
32
|
|
|
221
|
-
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
|
|
222
|
-
- STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY}
|
|
223
|
-
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
|
|
224
|
-
|
|
225
|
-
- LOG_LEVEL=${LOG_LEVEL:-TRACE}
|
|
226
|
-
- LOG_FORMAT=${LOG_FORMAT:-pretty}
|
|
227
|
-
|
|
228
|
-
- AUTH_JWT_JWKS=${AUTH_JWT_JWKS}
|
|
229
|
-
# Permissions Migration
|
|
230
33
|
permissions-migrate:
|
|
34
|
+
image: ""
|
|
231
35
|
build:
|
|
232
36
|
context: ../../../docker/permissions
|
|
233
37
|
dockerfile: Dockerfile
|
|
234
|
-
environment:
|
|
235
|
-
- DSN=postgres://postgres:postgres@postgres:5432/db?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=permissions
|
|
236
|
-
command: migrate up -c /etc/config/permissions/permissions.yml --yes
|
|
237
|
-
restart: on-failure
|
|
238
|
-
networks:
|
|
239
|
-
- app-network
|
|
240
|
-
depends_on:
|
|
241
|
-
- postgres
|
|
242
|
-
- rest-api
|
|
243
38
|
|
|
244
39
|
permissions:
|
|
245
|
-
|
|
246
|
-
- permissions-migrate
|
|
40
|
+
image: ""
|
|
247
41
|
build:
|
|
248
42
|
context: ../../../docker/permissions
|
|
249
43
|
dockerfile: Dockerfile
|
|
250
|
-
ports:
|
|
251
|
-
- "4466:4466" # read API
|
|
252
|
-
- "4467:4467" # write API
|
|
253
|
-
restart: unless-stopped
|
|
254
|
-
environment:
|
|
255
|
-
- DSN=postgres://postgres:postgres@postgres:5432/db?sslmode=disable&max_conns=20&max_idle_conns=4&search_path=permissions
|
|
256
|
-
- LOG_LEVEL=debug
|
|
257
|
-
- NAMESPACE_BUCKET=dev
|
|
258
|
-
- R2_ENDPOINT=http://minio:9000
|
|
259
|
-
- R2_ACCESS_KEY=minioadmin
|
|
260
|
-
- R2_SECRET_KEY=minioadmin123
|
|
261
|
-
command: serve -c /etc/config/permissions/permissions.yml
|
|
262
|
-
networks:
|
|
263
|
-
- app-network
|
|
264
|
-
|
|
265
|
-
postgres-type-gen:
|
|
266
|
-
image: supabase/postgres-meta:canary-pr-971
|
|
267
|
-
ports:
|
|
268
|
-
- 8079:8080
|
|
269
|
-
environment:
|
|
270
|
-
- PG_META_DB_HOST=postgres
|
|
271
|
-
- PG_META_DB_NAME=db
|
|
272
|
-
- PG_META_DB_USER=postgres
|
|
273
|
-
- PG_META_DB_PASSWORD=postgres
|
|
274
|
-
- PG_META_DB_PORT=5432
|
|
275
|
-
depends_on:
|
|
276
|
-
- postgres
|
|
277
|
-
networks:
|
|
278
|
-
- app-network
|
|
279
|
-
|
|
280
|
-
volumes:
|
|
281
|
-
postgres_data:
|
|
282
|
-
driver: local
|
|
283
|
-
minio_data:
|
|
284
|
-
driver: local
|
|
285
|
-
|
|
286
|
-
networks:
|
|
287
|
-
app-network:
|
|
288
|
-
driver: bridge
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Local development overrides - persistent data volumes
|
|
2
|
+
services:
|
|
3
|
+
postgres:
|
|
4
|
+
volumes:
|
|
5
|
+
- postgres_data:/var/lib/postgresql/data
|
|
6
|
+
|
|
7
|
+
minio:
|
|
8
|
+
volumes:
|
|
9
|
+
- minio_data:/data
|
|
10
|
+
|
|
11
|
+
volumes:
|
|
12
|
+
postgres_data:
|
|
13
|
+
driver: local
|
|
14
|
+
minio_data:
|
|
15
|
+
driver: local
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Performance test overrides - uses stripe-mock for load testing without rate limits
|
|
2
|
+
services:
|
|
3
|
+
auth-migrate:
|
|
4
|
+
image: ""
|
|
5
|
+
build:
|
|
6
|
+
context: ../../../docker/auth
|
|
7
|
+
dockerfile: Dockerfile
|
|
8
|
+
volumes:
|
|
9
|
+
- type: bind
|
|
10
|
+
source: ../../../docker/auth
|
|
11
|
+
target: /etc/config/auth
|
|
12
|
+
|
|
13
|
+
auth:
|
|
14
|
+
image: ""
|
|
15
|
+
build:
|
|
16
|
+
context: ../../../docker/auth
|
|
17
|
+
dockerfile: Dockerfile
|
|
18
|
+
volumes:
|
|
19
|
+
- type: bind
|
|
20
|
+
source: ../../../docker/auth
|
|
21
|
+
target: /etc/config/auth
|
|
22
|
+
|
|
23
|
+
rest-api:
|
|
24
|
+
image: ""
|
|
25
|
+
build:
|
|
26
|
+
context: ../../../apps/api
|
|
27
|
+
dockerfile: Dockerfile
|
|
28
|
+
volumes:
|
|
29
|
+
- ../../../apps/api:/app
|
|
30
|
+
environment:
|
|
31
|
+
- STRIPE_API_URL=http://stripe-mock:12111
|
|
32
|
+
- ENABLE_PPROF=true
|
|
33
|
+
depends_on:
|
|
34
|
+
- stripe-mock
|
|
35
|
+
deploy:
|
|
36
|
+
resources:
|
|
37
|
+
limits:
|
|
38
|
+
memory: 512M
|
|
39
|
+
cpus: "0.25"
|
|
40
|
+
|
|
41
|
+
stripe-mock:
|
|
42
|
+
image: stripe/stripe-mock:latest
|
|
43
|
+
ports:
|
|
44
|
+
- "12111:12111"
|
|
45
|
+
networks:
|
|
46
|
+
- app-network
|
|
47
|
+
|
|
48
|
+
permissions-migrate:
|
|
49
|
+
image: ""
|
|
50
|
+
build:
|
|
51
|
+
context: ../../../docker/permissions
|
|
52
|
+
dockerfile: Dockerfile
|
|
53
|
+
|
|
54
|
+
permissions:
|
|
55
|
+
image: ""
|
|
56
|
+
build:
|
|
57
|
+
context: ../../../docker/permissions
|
|
58
|
+
dockerfile: Dockerfile
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Test overrides - local builds without hot-reload (runs Go binary directly)
|
|
2
|
+
services:
|
|
3
|
+
auth-migrate:
|
|
4
|
+
image: ""
|
|
5
|
+
build:
|
|
6
|
+
context: ../../../docker/auth
|
|
7
|
+
dockerfile: Dockerfile
|
|
8
|
+
volumes:
|
|
9
|
+
- type: bind
|
|
10
|
+
source: ../../../docker/auth
|
|
11
|
+
target: /etc/config/auth
|
|
12
|
+
|
|
13
|
+
auth:
|
|
14
|
+
image: ""
|
|
15
|
+
build:
|
|
16
|
+
context: ../../../docker/auth
|
|
17
|
+
dockerfile: Dockerfile
|
|
18
|
+
volumes:
|
|
19
|
+
- type: bind
|
|
20
|
+
source: ../../../docker/auth
|
|
21
|
+
target: /etc/config/auth
|
|
22
|
+
|
|
23
|
+
rest-api:
|
|
24
|
+
image: ""
|
|
25
|
+
build:
|
|
26
|
+
context: ../../../apps/api
|
|
27
|
+
dockerfile: Dockerfile.test
|
|
28
|
+
environment:
|
|
29
|
+
- ENABLE_PPROF=true
|
|
30
|
+
volumes:
|
|
31
|
+
- ../../../apps/api:/app
|
|
32
|
+
|
|
33
|
+
permissions-migrate:
|
|
34
|
+
image: ""
|
|
35
|
+
build:
|
|
36
|
+
context: ../../../docker/permissions
|
|
37
|
+
dockerfile: Dockerfile
|
|
38
|
+
|
|
39
|
+
permissions:
|
|
40
|
+
image: ""
|
|
41
|
+
build:
|
|
42
|
+
context: ../../../docker/permissions
|
|
43
|
+
dockerfile: Dockerfile
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[databases]
|
|
2
|
+
* = host=postgres port=5432
|
|
3
|
+
|
|
4
|
+
[pgbouncer]
|
|
5
|
+
listen_addr = 0.0.0.0
|
|
6
|
+
listen_port = 6432
|
|
7
|
+
auth_type = scram-sha-256
|
|
8
|
+
|
|
9
|
+
; auth_file is auto-generated by edoburu/pgbouncer from DATABASE_URL
|
|
10
|
+
auth_file = /etc/pgbouncer/userlist.txt
|
|
11
|
+
|
|
12
|
+
; Use auth_query for dynamic user authentication from PostgreSQL
|
|
13
|
+
; auth_user connects to PostgreSQL to run auth_query
|
|
14
|
+
auth_user = postgres
|
|
15
|
+
auth_query = SELECT usename, passwd FROM pg_shadow WHERE usename=$1
|
|
16
|
+
|
|
17
|
+
; Pool settings - transaction mode for high concurrency
|
|
18
|
+
; NOTE: These are generous for stress testing. Tune down for production multi-tenant.
|
|
19
|
+
pool_mode = transaction
|
|
20
|
+
max_client_conn = 2000
|
|
21
|
+
default_pool_size = 100
|
|
22
|
+
min_pool_size = 20
|
|
23
|
+
reserve_pool_size = 20
|
|
24
|
+
reserve_pool_timeout = 3
|
|
25
|
+
|
|
26
|
+
; Enable prepared statement tracking (PgBouncer 1.21+)
|
|
27
|
+
; This allows transaction pooling to work with prepared statements
|
|
28
|
+
max_prepared_statements = 100
|
|
29
|
+
|
|
30
|
+
; Connection limits - generous for stress testing
|
|
31
|
+
max_db_connections = 200
|
|
32
|
+
max_user_connections = 200
|
|
33
|
+
|
|
34
|
+
; Timeouts
|
|
35
|
+
server_idle_timeout = 600
|
|
36
|
+
server_lifetime = 3600
|
|
37
|
+
server_connect_timeout = 15
|
|
38
|
+
query_timeout = 0
|
|
39
|
+
query_wait_timeout = 120
|
|
40
|
+
|
|
41
|
+
; Startup parameters to ignore (search_path is handled by user defaults)
|
|
42
|
+
ignore_startup_parameters = extra_float_digits
|
|
43
|
+
|
|
44
|
+
; Logging
|
|
45
|
+
log_connections = 0
|
|
46
|
+
log_disconnections = 0
|
|
47
|
+
log_pooler_errors = 1
|
|
48
|
+
|
|
49
|
+
; Admin access
|
|
50
|
+
admin_users = postgres
|
|
51
|
+
stats_users = postgres
|