Skip to content

Commit

Permalink
refactor: remove supabase, add postgres, fixed tests
Browse files Browse the repository at this point in the history
Co-authored-by: Josue <manekenpix@fastmail.com>
  • Loading branch information
manekenpix authored and chrispinkney committed Apr 11, 2023
1 parent e69611a commit f4fcb0a
Show file tree
Hide file tree
Showing 36 changed files with 216 additions and 1,020 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ certs/
# Redis data storage
redis-data/

# Postgres
db

.pnpm-debug.log

# Turborepo
Expand Down
6 changes: 3 additions & 3 deletions 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;docker/supabase/supabase-development.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/development.yml


# The host where the Telescope 1.0 front-end and back-end are run.
Expand Down Expand Up @@ -262,7 +262,7 @@ MAX_POSTS_PER_PAGE=5
# Supabase Services
################################################################################

SUPABASE_URL=http://localhost/v1/supabase
SUPABASE_URL=postgresql://postgres:your-super-secret-and-long-postgres-password@db/postgres


# Auth
Expand Down Expand Up @@ -303,4 +303,4 @@ KONG_HTTPS_PORT=8912
POSTGRES_PORT=8913

## DB connection string
DATABASE_URL=postgresql://postgres:your-super-secret-and-long-postgres-password@localhost/postgres
DATABASE_URL=postgresql://postgres:your-super-secret-and-long-postgres-password@db/postgres
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;docker/supabase/docker-compose.yml;docker/supabase/supabase-production.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/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;docker/supabase/docker-compose.yml;docker/supabase/supabase-production.yml
COMPOSE_FILE=docker/docker-compose.yml;docker/production.yml


# The host where the Telescope 1.0 front-end and back-end are run.
Expand Down
15 changes: 7 additions & 8 deletions docker/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ services:
context: ../src/api/parser
cache_from:
- docker.cdot.systems/parser:buildcache
environment:
# In development and testing, the Parser service needs to contact the Supabase
# service directly via Docker vs through the http://localhost/v1/supabase domain.
- SUPABASE_URL=http://kong:8000
depends_on:
- elasticsearch
- traefik
Expand Down Expand Up @@ -108,10 +104,6 @@ services:
context: ../src/api/sso
cache_from:
- docker.cdot.systems/sso:buildcache
environment:
# In development and testing, the SSO service needs to contact the Supabase
# service directly via Docker vs through the http://localhost/v1/supabase domain.
- SUPABASE_URL=http://kong:8000
depends_on:
- test-web-content
- traefik
Expand Down Expand Up @@ -140,3 +132,10 @@ services:
context: ../src/api/dependency-discovery
cache_from:
- docker.cdot.systems/dependency-discovery:buildcache

db:
ports:
- '5432:5432'
volumes:
- ../db:/var/lib/postgresql/data
- ../src/db/prisma/schema.prisma:/app/schema.prisma
7 changes: 7 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,10 @@ services:
- 'traefik.http.middlewares.rss_bridge_prefix.stripprefix.prefixes=/${API_VERSION}/rss-bridge'
# Add our middleware to the router
- 'traefik.http.routers.rss_bridge.middlewares=rss_bridge_redirect,rss_bridge_prefix'

db:
image: postgres:15-alpine
container_name: 'db'
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
5 changes: 5 additions & 0 deletions docker/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,8 @@ services:
]
depends_on:
- studio

db:
volumes:
# We keep the actual data in a volume outside of git, so it survives restarts
- ../../supabase/volumes/db/data:/var/lib/postgresql/data
5 changes: 0 additions & 5 deletions docker/supabase/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions docker/supabase/backup/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions docker/supabase/backup/cron-tasks/create-backup

This file was deleted.

27 changes: 0 additions & 27 deletions docker/supabase/backup/restore-backup.sh

This file was deleted.

48 changes: 0 additions & 48 deletions docker/supabase/dev/data.sql

This file was deleted.

20 changes: 0 additions & 20 deletions docker/supabase/dev/docker-compose.dev.yml

This file was deleted.

164 changes: 0 additions & 164 deletions docker/supabase/docker-compose.yml

This file was deleted.

Loading

0 comments on commit f4fcb0a

Please sign in to comment.