Skip to content

Commit

Permalink
Modify docker-compose for Supabase in dev/prod (#3368)
Browse files Browse the repository at this point in the history
  • Loading branch information
TueeNguyen authored Mar 31, 2022
1 parent 6abc2e7 commit 9d86ea7
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 22 deletions.
2 changes: 1 addition & 1 deletion config/env.development
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DOCKER_BUILDKIT=1
# so it will work on Windows and Unix, see
# https://docs.docker.com/compose/reference/envvars/#compose_file
COMPOSE_PATH_SEPARATOR=;
COMPOSE_FILE=docker/docker-compose.yml;docker/development.yml;docker/supabase/docker-compose.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/development.yml;docker/supabase/docker-compose.yml;docker/supabase/supabase-development.yml


# The host where the Telescope 1.0 front-end and back-end are run.
Expand Down
2 changes: 1 addition & 1 deletion config/env.production
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DOCKER_BUILDKIT=1
# so it will work on Windows and Unix, see
# https://docs.docker.com/compose/reference/envvars/#compose_file
COMPOSE_PATH_SEPARATOR=;
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml;docker/supabase/docker-compose.yml;docker/supabase/supabase-production.yml


# The host where the Telescope 1.0 front-end and back-end are run.
Expand Down
2 changes: 1 addition & 1 deletion config/env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DOCKER_BUILDKIT=1
# so it will work on Windows and Unix, see
# https://docs.docker.com/compose/reference/envvars/#compose_file
COMPOSE_PATH_SEPARATOR=;
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml;docker/supabase/docker-compose.yml;docker/supabase/supabase-production.yml


# The host where the Telescope 1.0 front-end and back-end are run.
Expand Down
21 changes: 2 additions & 19 deletions docker/supabase/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# Usage
# Start: docker-compose up
# With helpers: docker-compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up
# Stop: docker-compose down
# Destroy: docker-compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml down -v --remove-orphans

version: '3.8'
# This is the main Supabase container definition, and is meant to
# be run with one of supabase-development.yml or supabase-production.yml.

services:
studio:
container_name: supabase-studio
image: supabase/studio:latest
restart: unless-stopped
ports:
- ${STUDIO_PORT}:3000/tcp
environment:
SUPABASE_URL: http://kong:8000
STUDIO_PG_META_URL: http://meta:8080
Expand Down Expand Up @@ -140,8 +133,6 @@ services:
# TODO: https://github.com/supabase/storage-api/issues/55
REGION: stub
GLOBAL_S3_BUCKET: stub
volumes:
- ./supabase/volumes/storage:/var/lib/storage

meta:
container_name: supabase-meta
Expand All @@ -159,13 +150,5 @@ services:
image: supabase/postgres:14.1.0
command: postgres -c config_file=/etc/postgresql/postgresql.conf
restart: unless-stopped
ports:
# XXX: we need access to the postgres port on localhost for our e2e tests in dev,
# since they need to wait on the postgres db to become ready before starting.
# See src/api/sso/jest.config.e2e.js
- '5432:5432'
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
# - ./supbase/volumes/db/data:/var/lib/postgresql/data
- ./supabase/volumes/db/init:/docker-entrypoint-initdb.d
19 changes: 19 additions & 0 deletions docker/supabase/supabase-development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This is meant to be used with ./docker-compose.yml in development
services:
studio:
ports:
- ${STUDIO_PORT}:3000/tcp

storage:
volumes:
- ./supabase/volumes/storage:/var/lib/storage

db:
ports:
# XXX: we need access to the postgres port on localhost for our e2e tests in dev,
# since they need to wait on the postgres db to become ready before starting.
# See src/api/sso/jest.config.e2e.js
- '5432:5432'
volumes:
- ./supabase/volumes/db/data:/var/lib/postgresql/data
- ./supabase/volumes/db/init:/docker-entrypoint-initdb.d
10 changes: 10 additions & 0 deletions docker/supabase/supabase-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This is meant to be used with ./docker-compose.yml in production
services:
storage:
volumes:
- ../../../supabase/volumes/storage:/var/lib/storage

db:
volumes:
- ../../../supabase/volumes/db/data:/var/lib/postgresql/data
- ./supabase/volumes/db/init:/docker-entrypoint-initdb.d

0 comments on commit 9d86ea7

Please sign in to comment.