Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(self-hosted): self hosted docker compose (#30674)

Andrew Valleteau419eba99a167
diff --git a/.github/workflows/self-host-tests-smoke.yml b/.github/workflows/self-host-tests-smoke.yml
new file mode 100644
index 00000000000..dd3d1b76a0c
--- /dev/null
+++ b/.github/workflows/self-host-tests-smoke.yml
@@ -0,0 +1,25 @@
+name: Self-Host Tests Smoke
+
+on:
+ pull_request:
+ branches: ['master']
+ paths:
+ - 'docker/**/*'
+
+# Cancel old builds on new commit for same workflow + branch/PR
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ sparse-checkout: |
+ docker/
+ - name: Run docker-compose up
+ # Ensure all services can be started and healthy with default config
+ run: cd docker && cp .env.example .env && docker compose up --wait
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 69be2e14a93..21da9cb3c59 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -17,9 +17,9 @@ services:
"CMD",
"node",
"-e",
- "require('http').get('http://localhost:3000/api/profile', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"
+ "fetch('http://studio:3000/api/profile').then((r) => {if (r.status !== 200) throw new Error(r.status)})"
]
- timeout: 5s
+ timeout: 10s
interval: 5s
retries: 3
depends_on:
@@ -246,7 +246,7 @@ services:
"--no-verbose",
"--tries=1",
"--spider",
- "http://localhost:5000/status"
+ "http://storage:5000/status"
]
timeout: 5s
interval: 5s
@@ -438,7 +438,7 @@ services:
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock:ro
environment:
LOGFLARE_API_KEY: ${LOGFLARE_API_KEY}
- command: [ "--config", "etc/vector/vector.yml" ]
+ command: [ "--config", "/etc/vector/vector.yml" ]
# Update the DATABASE_URL if you are using an external Postgres database
supavisor:
@@ -467,7 +467,7 @@ services:
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- - DATABASE_URL=ecto://postgres:${POSTGRES_PASSWORD}@db:${POSTGRES_PORT}/_supabase
+ - DATABASE_URL=ecto://supabase_admin:${POSTGRES_PASSWORD}@db:${POSTGRES_PORT}/_supabase
- CLUSTER_POSTGRES=true
- SECRET_KEY_BASE=UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq
- VAULT_ENC_KEY=your-encryption-key-32-chars-min
diff --git a/docker/volumes/db/logs.sql b/docker/volumes/db/logs.sql
index b5d196b80b7..255c0f407b8 100644
--- a/docker/volumes/db/logs.sql
+++ b/docker/volumes/db/logs.sql
@@ -3,3 +3,4 @@
\c _supabase
create schema if not exists _analytics;
alter schema _analytics owner to :pguser;
+\c postgres
diff --git a/docker/volumes/db/pooler.sql b/docker/volumes/db/pooler.sql
index c9543d879b2..162c5b96aae 100644
--- a/docker/volumes/db/pooler.sql
+++ b/docker/volumes/db/pooler.sql
@@ -3,3 +3,4 @@
\c _supabase
create schema if not exists _supavisor;
alter schema _supavisor owner to :pguser;
+\c postgres