Skip to content

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

makeing our mount setup far more robust (#3995)

Copple663490876e5b
diff --git a/docker/.gitignore b/docker/.gitignore
index 33c83313c67..b6681ca8a64 100644
--- a/docker/.gitignore
+++ b/docker/.gitignore
@@ -1,4 +1,6 @@
-volumes/db/data
-volumes/storage
+volumes/db/data/**/*
+!volumes/db/data/.gitkeep
+volumes/storage/data/**/*
+!volumes/storage/data/.gitkeep
.env
test.http
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 36df1da73a3..e290a2705d3 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -1,3 +1,5 @@
+version: "3.8"
+
services:
kong:
container_name: supabase-kong
@@ -7,7 +9,9 @@ services:
- ${KONG_HTTP_PORT}:8000/tcp
- ${KONG_HTTPS_PORT}:8443/tcp
volumes:
- - ./volumes/kong.yml:/var/lib/kong/kong.yml
+ - type: bind
+ source: ./volumes/kong.yml
+ target: /var/lib/kong/kong.yml
environment:
KONG_DATABASE: "off"
KONG_DECLARATIVE_CONFIG: /var/lib/kong/kong.yml
@@ -85,7 +89,9 @@ services:
- rest
restart: unless-stopped
volumes:
- - ./volumes/storage:/var/lib/storage
+ - type: volume
+ source: volume_storage
+ target: /var/lib/storage
environment:
ANON_KEY: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyNzIwODU0MCwiZXhwIjoxOTc0MzYzNzQwfQ.zcaQfHd3VA7XgJmdGfmV86OLVJT9s2MTmSy-e69BpUY
SERVICE_KEY: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjI3MjA4NTQwLCJleHAiOjE5NzQzNjM3NDB9.pkT3PNpO4DtO45Ac5HK_TKCx8sGLgNtV__pr_ZrRSAU
@@ -114,12 +120,32 @@ services:
db:
container_name: supabase-db
image: supabase/postgres:13.3.0
+ command: postgres -c wal_level=logical
restart: unless-stopped
ports:
- ${POSTGRES_PORT}:5432
volumes:
- - ./volumes/db/data:/var/lib/postgresql/data
- - ./volumes/db/init:/docker-entrypoint-initdb.d
+ - type: volume
+ source: volume_database
+ target: /var/lib/postgresql/data
+ - type: bind
+ source: ./volumes/db/init
+ target: /docker-entrypoint-initdb.d
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
- command: postgres -c wal_level=logical
+ PGDATA: /var/lib/postgresql/data/pgdata
+
+volumes:
+ volume_database:
+ driver: local
+ driver_opts:
+ type: none
+ device: ./volumes/db/data
+ o: bind
+
+ volume_storage:
+ driver: local
+ driver_opts:
+ type: none
+ device: ./volumes/storage/data
+ o: bind
\ No newline at end of file
diff --git a/docker/volumes/db/data/.gitkeep b/docker/volumes/db/data/.gitkeep
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/docker/volumes/storage/data/.gitkeep b/docker/volumes/storage/data/.gitkeep
new file mode 100644
index 00000000000..e69de29bb2d