-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
282 lines (270 loc) · 10.2 KB
/
docker-compose.yml
File metadata and controls
282 lines (270 loc) · 10.2 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
services:
# Supabase Local Stack
supabase-db:
image: postgres:15-alpine
container_name: trust-center-db
ports:
- "5432:5432"
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- supabase-db-data:/var/lib/postgresql/data
- ./supabase/migrations:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- trust-center-network
supabase-studio:
image: supabase/studio:20240422-5cf8f30
container_name: trust-center-studio
ports:
- "54323:3000"
environment:
STUDIO_PG_META_URL: http://supabase-meta:8080
POSTGRES_PASSWORD: postgres
DEFAULT_ORGANIZATION_NAME: Default Organization
DEFAULT_PROJECT_NAME: Default Project
SUPABASE_URL: http://supabase-kong:8000
SUPABASE_PUBLIC_URL: http://localhost:8000
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
SUPABASE_SERVICE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
NEXT_PUBLIC_ENABLE_LOGS: "true"
NEXT_ANALYTICS_BACKEND_PROVIDER: postgres
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/profile', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"]
timeout: 5s
interval: 5s
retries: 3
depends_on:
supabase-db:
condition: service_healthy
supabase-meta:
condition: service_healthy
networks:
- trust-center-network
restart: unless-stopped
supabase-kong:
image: kong:2.8.1
container_name: trust-center-kong
ports:
- "8000:8000"
environment:
KONG_DATABASE: "off"
KONG_DECLARATIVE_CONFIG: /var/lib/kong/kong.yml
volumes:
- ./supabase/kong.yml:/var/lib/kong/kong.yml
networks:
- trust-center-network
supabase-auth:
# Using public ECR registry for better availability
image: public.ecr.aws/supabase/gotrue:v2.99.0
container_name: trust-center-auth
ports:
- "9999:9999"
environment:
GOTRUE_API_HOST: 0.0.0.0
GOTRUE_API_PORT: 9999
API_EXTERNAL_URL: http://localhost:8000
GOTRUE_DB_DRIVER: postgres
GOTRUE_DB_DATABASE_URL: postgres://postgres:postgres@supabase-db:5432/postgres?search_path=auth
DB_NAMESPACE: auth
GOTRUE_SITE_URL: http://localhost:3000
GOTRUE_URI_ALLOW_LIST: http://localhost:3000,http://localhost:4000
GOTRUE_DISABLE_SIGNUP: false
GOTRUE_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
GOTRUE_JWT_EXP: 3600
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
GOTRUE_EXTERNAL_EMAIL_ENABLED: true
GOTRUE_MAILER_AUTOCONFIRM: true
depends_on:
supabase-db:
condition: service_healthy
networks:
- trust-center-network
supabase-storage:
# Using public ECR registry for better availability
image: public.ecr.aws/supabase/storage-api:v1.0.6
container_name: trust-center-storage
ports:
- "5001:5000"
environment:
ANON_KEY: ${ANON_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0}
SERVICE_KEY: ${SERVICE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU}
POSTGRES_HOST: supabase-db
POSTGRES_PORT: 5432
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DATABASE_URL: postgres://postgres:postgres@supabase-db:5432/postgres
PGRST_DB_URI: postgres://postgres:postgres@supabase-db:5432/postgres
PGRST_DB_SCHEMAS: public,storage
PGRST_DB_EXTRA_SEARCH_PATH: public,extensions
PGRST_DB_ANON_ROLE: anon
PGRST_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
FILE_SIZE_LIMIT: 52428800
STORAGE_BACKEND: file
FILE_STORAGE_BACKEND_PATH: /var/lib/storage
TENANT_ID: stub
# Storage API specific settings
GLOBAL_S3_BUCKET: ""
STORAGE_S3_BACKEND_BUCKET: ""
STORAGE_S3_BACKEND_REGION: ""
STORAGE_S3_BACKEND_ENDPOINT: ""
volumes:
- supabase-storage-data:/var/lib/storage
depends_on:
supabase-db:
condition: service_healthy
supabase-rest:
condition: service_started
networks:
- trust-center-network
restart: unless-stopped
supabase-meta:
image: public.ecr.aws/supabase/postgres-meta:v0.78.0
container_name: trust-center-meta
environment:
PG_META_PORT: 8080
PG_META_DB_HOST: supabase-db
PG_META_DB_PORT: 5432
PG_META_DB_NAME: postgres
PG_META_DB_USER: postgres
PG_META_DB_PASSWORD: postgres
depends_on:
supabase-db:
condition: service_healthy
networks:
- trust-center-network
supabase-rest:
image: postgrest/postgrest:latest
container_name: trust-center-rest
environment:
PGRST_DB_URI: postgres://postgres:postgres@supabase-db:5432/postgres
PGRST_DB_SCHEMAS: public,storage
PGRST_DB_EXTRA_SEARCH_PATH: public,extensions
PGRST_DB_ANON_ROLE: anon
PGRST_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
depends_on:
supabase-db:
condition: service_healthy
networks:
- trust-center-network
# Backend API
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
container_name: trust-center-backend
ports:
- "4000:4000"
environment:
NODE_ENV: development
PORT: 4000
SUPABASE_URL: http://supabase-kong:8000
SUPABASE_ANON_KEY: ${ANON_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0}
SUPABASE_SERVICE_KEY: ${SERVICE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU}
DATABASE_URL: postgres://postgres:postgres@supabase-db:5432/postgres
JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
UPLOADS_DIR: /app/uploads
# Email configuration
# For local dev (Mailpit): EMAIL_PROVIDER=mailpit (default)
# For production (SendGrid - RECOMMENDED): EMAIL_PROVIDER=sendgrid, SENDGRID_API_KEY=SG.xxxxx
# Alternative (Resend): EMAIL_PROVIDER=resend, RESEND_API_KEY=re_xxxxx
# Alternative (SMTP): EMAIL_PROVIDER=smtp, SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD
EMAIL_PROVIDER: ${EMAIL_PROVIDER:-mailpit}
SENDGRID_API_KEY: ${SENDGRID_API_KEY:-}
RESEND_API_KEY: ${RESEND_API_KEY:-}
# SMTP settings (for Mailpit compatibility)
SMTP_HOST: ${SMTP_HOST:-mailpit}
SMTP_PORT: ${SMTP_PORT:-1025}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
SMTP_FROM: ${SMTP_FROM:[email protected]}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
SALESFORCE_CLIENT_ID: ${SALESFORCE_CLIENT_ID:-}
SALESFORCE_CLIENT_SECRET: ${SALESFORCE_CLIENT_SECRET:-}
SALESFORCE_REDIRECT_URI: ${SALESFORCE_REDIRECT_URI:-http://localhost:4000/api/admin/integrations/salesforce/callback}
SALESFORCE_AUTH_BASE_URL: ${SALESFORCE_AUTH_BASE_URL:-https://login.salesforce.com}
SALESFORCE_API_VERSION: ${SALESFORCE_API_VERSION:-v59.0}
SALESFORCE_STATUS_FIELD: ${SALESFORCE_STATUS_FIELD:-Type}
SALESFORCE_ALLOWED_STATUSES: ${SALESFORCE_ALLOWED_STATUSES:-Customer,Active Customer}
SALESFORCE_DOMAIN_FIELD: ${SALESFORCE_DOMAIN_FIELD:-Website}
DOCUMENT_UPLOADS_ENABLED: ${DOCUMENT_UPLOADS_ENABLED:-true}
DOCUMENT_UPLOAD_ADMIN_EMAIL_ALLOWLIST: ${DOCUMENT_UPLOAD_ADMIN_EMAIL_ALLOWLIST:-}
DOCUMENT_UPLOADS_PER_MINUTE: ${DOCUMENT_UPLOADS_PER_MINUTE:-20}
DOCUMENT_UPLOAD_MAX_MB: ${DOCUMENT_UPLOAD_MAX_MB:-25}
DEMO_ALLOW_DOCUMENT_UPLOADS: ${DEMO_ALLOW_DOCUMENT_UPLOADS:-false}
volumes:
- ./backend:/app
- /app/node_modules
- backend-uploads:/app/uploads
command: npm run dev
depends_on:
supabase-db:
condition: service_healthy
networks:
- trust-center-network
restart: unless-stopped
# Frontend Next.js
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
container_name: trust-center-frontend
ports:
- "3000:3000"
environment:
NODE_ENV: development
NEXT_PUBLIC_SUPABASE_URL: http://localhost:8000
SUPABASE_URL: http://supabase-kong:8000
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${ANON_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0}
NEXT_PUBLIC_API_URL: http://localhost:4000
API_URL: http://trust-center-backend:4000
volumes:
- ./frontend:/app
- /app/node_modules
- frontend-next:/app/.next
command: npm run dev
depends_on:
- backend
networks:
- trust-center-network
restart: unless-stopped
# pgAdmin - Alternative database admin (simpler than Supabase Studio)
pgadmin:
image: dpage/pgadmin4:latest
container_name: trust-center-pgadmin
ports:
- "5050:80"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
PGADMIN_CONFIG_SERVER_MODE: 'False'
depends_on:
- supabase-db
networks:
- trust-center-network
restart: unless-stopped
# Mailpit - Local mail server for development (captures all emails)
mailpit:
image: axllent/mailpit:latest
container_name: trust-center-mailpit
ports:
- "8025:8025" # Web UI
- "1025:1025" # SMTP
networks:
- trust-center-network
restart: unless-stopped
volumes:
supabase-db-data:
supabase-storage-data:
backend-uploads:
frontend-next:
networks:
trust-center-network:
driver: bridge