Building Postgres with docker-compose
rob8624
HOBBYOP

a year ago

Hi folks, i'm just trying to start a deployment using docker-compose (awesopme work on adding this btw). I need to add varibles PGHOST, PGPORT, PGUSER………, where do i obtain this once the Postgres service is built? Just confused on how to handle connecting Db with compose.

project id c09e5027-23b0-4a6d-a30f-924d3bb5cef4

Solved

15 Replies

a year ago

PGHOST=${{RAILWAY_PRIVATE_DOMAIN}}
PGPORT=5432
PGUSER=

rob8624
HOBBYOP

a year ago

Ok cool. Postgres deployed but i get

`django.db.utils.OperationalError: could not translate host name "

postgres" to address: Name or service not known
`

In Django. hmmmm….env's are correct from what i can see in django.


a year ago

Is postgres the correct private domain name?


rob8624
HOBBYOP

a year ago

By that do you mean this ?

1340384315447443500


a year ago

is Postgres in the same project?


rob8624
HOBBYOP

a year ago

yea


a year ago

Is the error during build or runtime?


rob8624
HOBBYOP

a year ago

rutime. Postgres builds, Django builds, but then fails at runtime


a year ago

I think it would be best for you to use the Postgres Railway template instead of the insecure Postgres deployment you have made


rob8624
HOBBYOP

a year ago

yea ok. I presume it the result of incorrect compose ?


rob8624
HOBBYOP

a year ago

First time testing docker-compose deployment


a year ago

yeah best to use Railway primitives


rob8624
HOBBYOP

a year ago

Yea ok cool. Django/Postgres can build via template and I can use compose for other service reliant on an image, which was working OK.

Cheers Brody for advice as always.


a year ago

no problem!


a year ago

!s


Status changed to Solved brody about 1 year ago


Loading...