Usage with local database #1121
Replies: 1 comment
-
Yes~, will provide my config when I'm back home.~ Here our docker-compose.yaml name: local_stack
services:
backend:
container_name: "backend"
env_file:
- .env.docker
environment:
- BACKEND_PORT=4000
- RDS_HOST=postgres
build:
context: .
dockerfile: ./apps/backend/Dockerfile
args:
- CI=1
- PROJECT=backend
restart: always
ports:
- 4000:4000
networks:
- docker_network
depends_on:
- postgres
frontend:
container_name: "frontend"
env_file:
- .env.docker
environment:
- RDS_HOST=postgres
build:
context: .
dockerfile: ./apps/frontend/Dockerfile
args:
- CI=1
- PROJECT=frontend
restart: always
ports:
- 3000:8080
networks:
- docker_network
depends_on:
- postgres
postgres:
container_name: postgres
image: postgres
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: local_database
ports:
- 5432:5432
expose:
- 5432
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
- docker_network
networks:
docker_network:
We're using a dedicated Here the relevant part for the RDS / DB variables: # Database
RDS_ENGINE="postgres"
RDS_HOST="postgres"
RDS_PORT=5432
RDS_USERNAME="postgres"
RDS_PASSWORD="postgres"
RDS_DBNAME="local_database"
RDS_DEBUG=false
RDS_URL=${RDS_ENGINE}://${RDS_USERNAME}:${RDS_PASSWORD}@postgres:${RDS_PORT}/${RDS_DBNAME} Why not using the default Our Dockerfile is based on this howto: We just modified the Dockerfile to make it work
Hope this helps you. |
Beta Was this translation helpful? Give feedback.
-
I have this working locally and in production, pointing to a supabase production db. Everything works fine.
Now I want to do local db, and I pulled the db image from supabase. The migration works, however, when running nextjs, it is not communicating with the db.
Getting this error:
With a conn string of:
Note: localhost didn't work, a nonsensical error was thrown that talks about websockets.
the docker-compose.yml:
Anyone able to get a local workflow going?
Beta Was this translation helpful? Give feedback.
All reactions