![]() ![]() So I removed the DATABASE_URL secret in favor of keeping it in my config/database.yml as such: default: &default Then you’ll just have to make sure that your app uses those environment variables to connect to each. It should give you the option to set up both databases and will automatically configure DATABASE_URL and REDIS_URL secrets on your Rails app with the right values. ![]() It’s also possible to run Postgres and Redis images manually on Fly if you really want to.įinally, if you’re interested in using Fly Postgres and/or Upstash, you might consider deleting your app and running fly launch again. So far, you’ve deployed your Rails application, so you’ll want to create a Postgres app and a Redis app next, and configure your app to connect to them (probably with secrets).Īs I mentioned, Fly Postgres is a possibility for the database. The Fly equivalent of a service in your Docker compose file would indeed be an individual app, so the usual way to run this on Fly would be as three apps (within a single organization, so that they are all connected to the same private network, much like Docker Compose networking). So in fact you’re running a single service per container already! Your Docker Compose file actually defines three separate Docker containers, one for each service. Since you said you’re fairly new to this, I hope you won’t mind if I clarify a bit. This is also slightly tied to other questions I will need answers to in the future involving persistent data and backups, so some lights here will be incredibly helpful. Or perhaps that should be running on a separate app? Looks like it isn’t being able to find the db service.Īm I wrong when assuming that one can run multiple services per Docker container on Fly.io? Now, on Fly.io I see the following error: T14:19:00.624 app mad ActiveRecord::ConnectionNotEstablished (could not translate host name "db" to address: Name or service not known My database.yml file connects to host: db (where my database is). On my local machine - and I really thought that by using Docker I would stop saying that - I can run this app both on development and production with no issues. This Docker container is composed of 3 services: app (a Rails 7 app), cache (Redis), and db (Postgres database). ![]() I have this Fly app that’s running from a Docker container. Early disclaimer: I’m fairly new to these subjects, as I’m usually more into frontend. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |