Skip to content

Commit 4041e1f

Browse files
authored
feat(backend/infra): Cleanup platform and db docker compose files (#10830)
Supabase `db/docker/docker-compose.yml` overrides env vars set in `autogpt_platform/.env` file. This PR fixes that and simplifies the compose files further. ### Changes 🏗️ `autogpt_platform/docker-compose.platform.yml`: - Move hardcoded `DATABASE_URL` and `DIRECT_URL` to `x-backend-env` on top as it repeats for most services. - Remove `RABBITMQ_DEFAULT_USER` and `RABBITMQ_DEFAULT_PASS` from `rabbitmq` service and use env files instead `autogpt_platform/db/docker/docker-compose.yml`: - Remove hardcoded env vars from `x-supabase-env` - these are already defined in `.env` - Remove env vars from services that are already defined in `.env` files *Changes to db compose file only affect self-hosted Supabase* ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Platform, db works when self-hosting
1 parent 7cbdc1a commit 4041e1f

File tree

2 files changed

+11
-119
lines changed

2 files changed

+11
-119
lines changed

autogpt_platform/db/docker/docker-compose.yml

Lines changed: 2 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -25,83 +25,10 @@ x-supabase-env-files: &supabase-env-files
2525

2626
# Common Supabase environment - hardcoded defaults to avoid variable substitution
2727
x-supabase-env: &supabase-env
28-
# Core PostgreSQL settings
29-
POSTGRES_PASSWORD: your-super-secret-and-long-postgres-password
30-
POSTGRES_HOST: db
31-
POSTGRES_PORT: "5432"
32-
POSTGRES_DB: postgres
33-
34-
# Authentication & Security
35-
JWT_SECRET: your-super-secret-jwt-token-with-at-least-32-characters-long
36-
ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
37-
SERVICE_ROLE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
38-
DASHBOARD_USERNAME: supabase
39-
DASHBOARD_PASSWORD: this_password_is_insecure_and_should_be_updated
40-
SECRET_KEY_BASE: UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq
41-
VAULT_ENC_KEY: your-encryption-key-32-chars-min
42-
43-
# URLs and Endpoints
44-
SITE_URL: http://localhost:3000
45-
API_EXTERNAL_URL: http://localhost:8000
46-
SUPABASE_PUBLIC_URL: http://localhost:8000
47-
ADDITIONAL_REDIRECT_URLS: ""
48-
49-
# Feature Flags
50-
DISABLE_SIGNUP: "false"
51-
ENABLE_EMAIL_SIGNUP: "true"
52-
ENABLE_EMAIL_AUTOCONFIRM: "false"
53-
ENABLE_ANONYMOUS_USERS: "false"
54-
ENABLE_PHONE_SIGNUP: "true"
55-
ENABLE_PHONE_AUTOCONFIRM: "true"
56-
FUNCTIONS_VERIFY_JWT: "false"
57-
IMGPROXY_ENABLE_WEBP_DETECTION: "true"
58-
59-
# Email/SMTP Configuration
60-
SMTP_ADMIN_EMAIL: [email protected]
61-
SMTP_HOST: supabase-mail
62-
SMTP_PORT: "2500"
63-
SMTP_USER: fake_mail_user
64-
SMTP_PASS: fake_mail_password
65-
SMTP_SENDER_NAME: fake_sender
66-
67-
# Mailer URLs
68-
MAILER_URLPATHS_CONFIRMATION: /auth/v1/verify
69-
MAILER_URLPATHS_INVITE: /auth/v1/verify
70-
MAILER_URLPATHS_RECOVERY: /auth/v1/verify
71-
MAILER_URLPATHS_EMAIL_CHANGE: /auth/v1/verify
72-
73-
# JWT Settings
74-
JWT_EXPIRY: "3600"
75-
76-
# Database Schemas
77-
PGRST_DB_SCHEMAS: public,storage,graphql_public
78-
79-
# Studio Settings
80-
STUDIO_DEFAULT_ORGANIZATION: Default Organization
81-
STUDIO_DEFAULT_PROJECT: Default Project
82-
83-
# Logging
84-
LOGFLARE_API_KEY: your-super-secret-and-long-logflare-key
85-
86-
# Pooler Settings
87-
POOLER_DEFAULT_POOL_SIZE: "20"
88-
POOLER_MAX_CLIENT_CONN: "100"
89-
POOLER_TENANT_ID: your-tenant-id
90-
POOLER_PROXY_PORT_TRANSACTION: "6543"
91-
92-
# Kong Ports
93-
KONG_HTTP_PORT: "8000"
94-
KONG_HTTPS_PORT: "8443"
95-
96-
# Docker
97-
DOCKER_SOCKET_LOCATION: /var/run/docker.sock
98-
99-
# Google Cloud (if needed)
100-
GOOGLE_PROJECT_ID: GOOGLE_PROJECT_ID
101-
GOOGLE_PROJECT_NUMBER: GOOGLE_PROJECT_NUMBER
28+
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
29+
SUPABASE_SERVICE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
10230

10331
services:
104-
10532
studio:
10633
container_name: supabase-studio
10734
image: supabase/studio:20250224-d10db0f
@@ -122,16 +49,9 @@ services:
12249
<<: *supabase-env
12350
# Keep any existing environment variables specific to that service
12451
STUDIO_PG_META_URL: http://meta:8080
125-
POSTGRES_PASSWORD: your-super-secret-and-long-postgres-password
126-
12752
DEFAULT_ORGANIZATION_NAME: Default Organization
12853
DEFAULT_PROJECT_NAME: Default Project
129-
OPENAI_API_KEY: ""
130-
13154
SUPABASE_URL: http://kong:8000
132-
SUPABASE_PUBLIC_URL: http://localhost:8000
133-
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
134-
SUPABASE_SERVICE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
13555
AUTH_JWT_SECRET: your-super-secret-jwt-token-with-at-least-32-characters-long
13656

13757
LOGFLARE_API_KEY: your-super-secret-and-long-logflare-key
@@ -163,10 +83,6 @@ services:
16383
KONG_PLUGINS: request-transformer,cors,key-auth,acl,basic-auth
16484
KONG_NGINX_PROXY_PROXY_BUFFER_SIZE: 160k
16585
KONG_NGINX_PROXY_PROXY_BUFFERS: 64 160k
166-
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
167-
SUPABASE_SERVICE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
168-
DASHBOARD_USERNAME: supabase
169-
DASHBOARD_PASSWORD: this_password_is_insecure_and_should_be_updated
17086
# https://unix.stackexchange.com/a/294837
17187
entrypoint: bash -c 'eval "echo \"$$(cat ~/temp.yml)\"" > ~/kong.yml && /docker-entrypoint.sh kong docker-start'
17288

@@ -197,7 +113,6 @@ services:
197113
# Keep any existing environment variables specific to that service
198114
GOTRUE_API_HOST: 0.0.0.0
199115
GOTRUE_API_PORT: 9999
200-
API_EXTERNAL_URL: http://localhost:8000
201116

202117
GOTRUE_DB_DRIVER: postgres
203118
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:your-super-secret-and-long-postgres-password@db:5432/postgres
@@ -425,9 +340,7 @@ services:
425340
environment:
426341
<<: *supabase-env
427342
# Keep any existing environment variables specific to that service
428-
JWT_SECRET: your-super-secret-jwt-token-with-at-least-32-characters-long
429343
SUPABASE_URL: http://kong:8000
430-
SUPABASE_ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
431344
SUPABASE_SERVICE_ROLE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
432345
SUPABASE_DB_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres
433346
# TODO: Allow configuring VERIFY_JWT per function. This PR might help: https://github.com/supabase/cli/pull/786
@@ -531,12 +444,8 @@ services:
531444
# Keep any existing environment variables specific to that service
532445
POSTGRES_HOST: /var/run/postgresql
533446
PGPORT: 5432
534-
POSTGRES_PORT: 5432
535447
PGPASSWORD: your-super-secret-and-long-postgres-password
536-
POSTGRES_PASSWORD: your-super-secret-and-long-postgres-password
537448
PGDATABASE: postgres
538-
POSTGRES_DB: postgres
539-
JWT_SECRET: your-super-secret-jwt-token-with-at-least-32-characters-long
540449
JWT_EXP: 3600
541450
command:
542451
[
@@ -570,8 +479,6 @@ services:
570479
<<: *supabase-env-files
571480
environment:
572481
<<: *supabase-env
573-
# Keep any existing environment variables specific to that service
574-
LOGFLARE_API_KEY: your-super-secret-and-long-logflare-key
575482
command:
576483
[
577484
"--config",
@@ -612,9 +519,6 @@ services:
612519
<<: *supabase-env
613520
# Keep any existing environment variables specific to that service
614521
PORT: 4000
615-
POSTGRES_PORT: 5432
616-
POSTGRES_DB: postgres
617-
POSTGRES_PASSWORD: your-super-secret-and-long-postgres-password
618522
DATABASE_URL: ecto://supabase_admin:your-super-secret-and-long-postgres-password@db:5432/_supabase
619523
CLUSTER_POSTGRES: true
620524
SECRET_KEY_BASE: UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq

autogpt_platform/docker-compose.platform.yml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
# 5. CLI arguments - docker compose run -e VAR=value
77

88
# Common backend environment - Docker service names
9-
x-backend-env:
10-
&backend-env # Docker internal service hostnames (override localhost defaults)
9+
x-backend-env: &backend-env # Docker internal service hostnames (override localhost defaults)
1110
PYRO_HOST: "0.0.0.0"
1211
AGENTSERVER_HOST: rest_server
1312
SCHEDULER_HOST: scheduler_server
@@ -20,6 +19,10 @@ x-backend-env:
2019
RABBITMQ_HOST: rabbitmq
2120
# Override Supabase URL for Docker network
2221
SUPABASE_URL: http://kong:8000
22+
# Database connection string for Docker network
23+
# This cannot be constructed like in .env because we cannot interpolate values set here (DB_HOST)
24+
DATABASE_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
25+
DIRECT_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
2326

2427
# Common env_file configuration for backend services
2528
x-backend-env-files: &backend-env-files
@@ -43,9 +46,9 @@ services:
4346
depends_on:
4447
db:
4548
condition: service_healthy
49+
<<: *backend-env-files
4650
environment:
47-
- DATABASE_URL=postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
48-
- DIRECT_URL=postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
51+
<<: *backend-env
4952
networks:
5053
- app-network
5154
restart: on-failure
@@ -81,9 +84,9 @@ services:
8184
timeout: 10s
8285
retries: 5
8386
start_period: 10s
87+
<<: *backend-env-files
8488
environment:
85-
- RABBITMQ_DEFAULT_USER=rabbitmq_user_default
86-
- RABBITMQ_DEFAULT_PASS=k0VMxyIJF9S35f3x2uaw5IWAl6Y536O7 # CHANGE THIS TO A RANDOM PASSWORD IN PRODUCTION -- everywhere lol
89+
<<: *backend-env
8790
ports:
8891
- "5672:5672"
8992
- "15672:15672"
@@ -111,9 +114,6 @@ services:
111114
<<: *backend-env-files
112115
environment:
113116
<<: *backend-env
114-
# Service-specific overrides
115-
DATABASE_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
116-
DIRECT_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
117117
ports:
118118
- "8006:8006"
119119
networks:
@@ -144,9 +144,6 @@ services:
144144
<<: *backend-env-files
145145
environment:
146146
<<: *backend-env
147-
# Service-specific overrides
148-
DATABASE_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
149-
DIRECT_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
150147
ports:
151148
- "8002:8002"
152149
networks:
@@ -175,9 +172,6 @@ services:
175172
<<: *backend-env-files
176173
environment:
177174
<<: *backend-env
178-
# Service-specific overrides
179-
DATABASE_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
180-
DIRECT_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
181175
ports:
182176
- "8001:8001"
183177
networks:
@@ -202,9 +196,6 @@ services:
202196
<<: *backend-env-files
203197
environment:
204198
<<: *backend-env
205-
# Service-specific overrides
206-
DATABASE_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
207-
DIRECT_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
208199
ports:
209200
- "8005:8005"
210201
networks:
@@ -248,9 +239,6 @@ services:
248239
<<: *backend-env-files
249240
environment:
250241
<<: *backend-env
251-
# Service-specific overrides
252-
DATABASE_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
253-
DIRECT_URL: postgresql://postgres:your-super-secret-and-long-postgres-password@db:5432/postgres?connect_timeout=60&schema=platform
254242
ports:
255243
- "8003:8003"
256244
networks:

0 commit comments

Comments
 (0)