Dockerized application on Railway (docker compose)
Below is example of django application using celery, redis and postgres db
Railway has databases redis and postgres which are straight forward way to set it up
But what about celery worker or any other extra workers, how to set them up?
There is also some volumes
I read there will downtime during deployment as well because of volumes? Would be nice to clarify how it works and how to generally set more complex applications that require multiple docker services to run?
Would I have each separate github repo just for each individual service such as celery? And how to make service talk to each other do we use internal railway network?
Thanks
Solution:Jump to solution
so as you may know Railway does not yet support docker compose, you would have to manually deconstruct the compose file into individual railway services manually
14 Replies
Project ID:
N/A
N/A
Dockerfile
Following.
I have the same use case. Django, Celery, Redis, and Caddy deployed on a single AWS EC2.
We do not have volumes though and DB is on RDS.
Solution
so as you may know Railway does not yet support docker compose, you would have to manually deconstruct the compose file into individual railway services manually
except you wouldn't need nginx or certbot since Railway handles SSL certs for you
Thanks, Brody
What about communication between apps can IP be pointed to service name or is IP internal railway app?
communication between apps can use the private network domains
Ty and how does volume downtime work? Are deployments zero downtime if theres no volume attached?
a service with a volume will incur some downtime, even if you use a healthcheck, this is done to prevent data corruption
One suitable solution I found you can leave docker-compose for easier development and then when taking it to production railway you essentially deploy github repo twice once you allow railway to detect Dockerfile and deploy it and second time you change run command to run celery
thats exactly right, the services would essentially be the exact same, with one having a start command to run celery
Communication between them should be on internal railway address but unfortunately keep in mind if you use app sleep (currently in beta) service won't wake up on internal railway address team is working on that
Can you mark it as solved please? Not sure how to do it, thank you for help appreciate it
thank you for also helping the other user in this thread 🙂
Thanks @pandas9 and @Brody for the pointers.