Hi everyone,
I've been struggling with this issue for two days and could really use some help as I'm blocked.
Context
I have a local Postgres instance running with four databases:
production
sandbox
hammerhead_production
postgres
Docker Setup
I've set up two services in my docker-compose.yml
file as follows:
services:
db:
image: postgres:13
env_file: ./docker.env
networks:
- backend-network
db2:
image: postgres:13
env_file: ./db2.env
networks:
- backend-network
I can connect to these Docker containerized Postgres instances using a database client (Navicat) without any issues.
I can get Docker to properly spin up Retool by pointing the docker compose file at the db
service. However, when I try to create a resource in Retool to connect to db
, it automatically connects to the hammerhead_production
database and only shows those tables. Similarly, when I try to create a resource to connect to db2
, it defaults to the postgres
database (even though I have specified the sandbox
database).
I cannot select the database I want to connect to in Retool. No matter which database I specify in the docker-compose.yml
file or in the Retool resource configuration, it always defaults to hammerhead_production
(for db
) or postgres
(for db2
). I need to connect to the sandbox
database.**
What I've tried
- Ensured that the
docker.env
anddb2.env
files correctly specify the desired database:
POSTGRES_DB=sandbox
POSTGRES_USER=my_user
POSTGRES_PASSWORD=my_password
POSTGRES_HOST=db (or db2)
- Explicitly set the
POSTGRES_DB
environment variable in thedocker-compose.yml
file:
services:
db:
image: postgres:13
env_file: ./docker.env
environment:
POSTGRES_DB: sandbox
networks:
- backend-network
db2:
image: postgres:13
env_file: ./db2.env
environment:
POSTGRES_DB: sandbox
networks:
- backend-network
- Restarted the Docker containers to apply changes:
docker-compose down
docker-compose up -d
Halp
Has anyone encountered a similar issue or have any suggestions on how to get Retool to connect to the correct database? Any advice would be greatly appreciated.
Thank you!