How can i deploy docker image with a database?
gaborlakatos
TRIALOP

2 years ago

So if I have a dockerized Fastapi app with a postgresql database how can i deploy it? Should I add database as a new service on railway or is it enough to deploy my docker image. I am pretty lost in this so any help is appreciated. Also ask me about anything I know its not that clear what I want.

1 Replies

2 years ago

Yes, If you need a database you will need to deploy a database.

Once deployed you can reference it's connection URL like so -

DATABASE_URL=${{Postgres.DATABASE_URL}}

And then use the environment variable DATABASE_URL in code to connect to it.


Loading...