Can I use railway to deploy my django application with minio and postgresql database?
gampr
FREEOP

a year ago

I built a huge huuuuge application with django backend, and important images stored in minio, linked to a postgres database. Now I need to deploy this somewhere. It also uses an smtp server for emails, but I’m thinking I can keep that with amazon while using railway for the rest of everything cause AWS is a pain in the ass full offense. So can I do this here and where can I find info on doing it for a case like this on railway is it in the docs? I don’t know where to start for this deployment.

50 Replies

gampr
FREEOP

a year ago

N/A


brody
EMPLOYEE

a year ago

we have a minio template, so deploying that would really only be a few clicks, same for postgres, then it's just up to you to deploy your repo with your Django app


gampr
FREEOP

a year ago

i’ve been using docker compose for this and in my django settings as well as other place i need to have all the information for the app right will i get the new information from railway and put it in settings from an env i’m trying to figure out what is going to happen to my docker here does it just evaporate and was a test env


brody
EMPLOYEE

a year ago

railway doesn't use docker compose, so it just wouldn't do anything, you would need to configure your railway service with all the needed environment variables and whatnot


gampr
FREEOP

a year ago

ok ok


gampr
FREEOP

a year ago

so yea like i’m picturing it just evaporates cause it becomes useless out my system


brody
EMPLOYEE

a year ago

Does your Django app already use environment variables for config? like database credentials and the MinIO endpoint?


gampr
FREEOP

a year ago

right now it’s all in settings.py and docker compose some of it


gampr
FREEOP

a year ago

but when i deployed i was gonna put it in env for the secret ones yea


gampr
FREEOP

a year ago

is it a bad idea? i don’t know how to do it a different way lol


brody
EMPLOYEE

a year ago

so you are hardcoding everything into settings.py?


gampr
FREEOP

a year ago

for at least some security


gampr
FREEOP

a year ago

yea


gampr
FREEOP

a year ago

i do that for security


gampr
FREEOP

a year ago

there is even more secure ways apparently


gampr
FREEOP

a year ago

it’s in case someone gets their hands on settings.py


gampr
FREEOP

a year ago

somehow


brody
EMPLOYEE

a year ago

that's far less secure lol


gampr
FREEOP

a year ago

you think so?


brody
EMPLOYEE

a year ago

hardcoding sensitive information yes


gampr
FREEOP

a year ago

so you would just keep it in settings?


gampr
FREEOP

a year ago

as strings


brody
EMPLOYEE

a year ago

no, as just mentioned thats very insecure, you need to use environment variables


gampr
FREEOP

a year ago

oh bro we are saying the same thing lol


brody
EMPLOYEE

a year ago

so get that done before you worry about deployment


gampr
FREEOP

a year ago

then you retrieve the env vars from settings yea that’s what i’m saying were saying the same thing on that, but i was also going to retrieve the env vars for docker but you told me i don’t need docker anymore


gampr
FREEOP

a year ago

so they will all be pulled by settings


gampr
FREEOP

a year ago

well i’m going to setup the env soon and then try to deploy it to railway see what happens


gampr
FREEOP

a year ago

and minio as well as postgres settings


brody
EMPLOYEE

a year ago

yeah deploy those first, then deploy an empty service, setup the variables needed, then attach your repo


gampr
FREEOP

a year ago

aaaaah i got my confusion


gampr
FREEOP

a year ago

i need to setup the vars for when i use them in docker right every time i docker compose up build


gampr
FREEOP

a year ago

i thought i was retrieving them there for some reason


gampr
FREEOP

a year ago

what getting off the screen for 5 minutes does to the brain


brody
EMPLOYEE

a year ago

no no they're set on the service, and those are injected into the environment


gampr
FREEOP

a year ago

yea yea


gampr
FREEOP

a year ago

that


gampr
FREEOP

a year ago

i thought i was retrieving them in docker compose


gampr
FREEOP

a year ago

instead of injecting them


gampr
FREEOP

a year ago

which i prob can but why would you


gampr
FREEOP

a year ago

like i can retrieve my systems or a environments variables in the docker compose then inject them in the docker variable but why would i do that


brody
EMPLOYEE

a year ago

you can't even if you wanted to, railway has zero concept of docker compose


gampr
FREEOP

a year ago

well i used docker so long for this for my local env and containers i have blurred it with django i had to unmix it


gampr
FREEOP

a year ago

now i get what is happening hahahaha


brody
EMPLOYEE

a year ago

awesome


gampr
FREEOP

a year ago

after a few painful hours i got it to deploy and retrieve css/js now i need to improve minio access policies and a lot of settings and api settings


brody
EMPLOYEE

a year ago

happy to hear that!


gampr
FREEOP

a year ago

thanks i sorta slammed it there is still so much to do at least 5 hours of work i would say before it’s working the way i want it to


gampr
FREEOP

a year ago

but now i know it is capable to at least


brody
EMPLOYEE

a year ago

im sure youve learnt a lot in the process


Loading...