#Docker deployment with postgres db

1 messages · Page 1 of 1 (latest)

lofty shuttle
#

I am trying to deploy the backstage application connected with postgres but im getting the below error:
Backend failed to start up Error: Failed to connect to the database to make sure that 'backstage_plugin_catalog' exists, Error: connect ECONNREFUSED 127.0.0.1:5433

app-config: -
database:
client: pg
connection:
host: localhost
port: 5433
user: postgres
password: someSecret

Docker Compose:
services:
backstage:
image: backstage:4.5
restart: always
container_name: backstage
ports:
- 7007:7007
networks:
- backstage_network

postgres:
image: postgres
restart: always
container_name: postgres
ports:
- 5433:5432
volumes:
- postgres_data:/var/lib/postgres/data
environment:
- POSTGRES_PASSWORD=someSecret
networks:
- backstage_network

Anyone got an idea whats missing and how to setup backstage_plugin_catalog
@undone owl

undone owl
#

this most likely isn't a backstage issue, but rather an issue of how you set up your docker

#

if it can't connect on that address, it can't connect

#

could be any of a number of things

#

like, in your particular docker env, is 127.0.0.1 really the right address to use for that separate container

#

are you missing some network setup

#

are you missing some startup condition that waits for the docker container to finish intializing at startup before the second container tries to connect to it

#

etc

#

for this one, i think you're on your own

#

i usually don't use docker compose at all personally, i just fire up postgres in a separate terminal if i want to test against that specifically

#

and in prod it's of course a properly deployed separate instance

marsh hare
#

Hi @lofty shuttle , May I check whether you have tried to open pgAdmin and verify the connection settings for the PostgreSQL instance.
It had once resolved the issue for me. Confirm that the PostgreSQL service is running. If it's not running, start the service. Also, sometimes, restarting the pgAdmin application can resolve connection issues.