Understanding my deploy with Dockerfile

Hello everyone!

I’ve deployed an app and it works quite well. However I’m trying to learn what is really going on to have a good understanding of this phase of development (deploying).

  1. It was deployed on Fly.io with the Dockerfile/docker-compose option
  2. It’s a container stack of a main app container (at 8080:8080), a Postgres container (at 5432:5432) and a redis container (6379/tcp). Redis container on Docker desktop doesn’t appear but I know it’s 6379/tcp. The feature that relies on it works normally on the main app.
  3. I deployed the project with flyctl then got two machines: #1 with the main app and #2 with the database.

When I run locally with my Docker desktop, I see the 3 containers in the same stack, all running separately. However, after deploying I see only 2 Machines, therefore I can access via console only the main app’s image/machine and the database.

How could I access the image of the redis’ container? I know its ports is not 6379:6379 but 6379/tcp (it seems that it only can be reached from the containers’ environment) but I don’t understand it quite well.
Could anyone explain me that? And how could I login on its system (using flyctl console …) ?

Thank you very much!

Hi, I’m not sure I fully understand what you mean by the “docker-compose option”.

Could you explain how you attempted to deploy each of the 3 containers? You have two apps so I think you’ve successfully deployed those two (the main app and Postgres). Did you try but fail to deploy the Redis container? Or are you trying to setup Upstash Redis?

Let me know and I can try to help you out!

Hello @jfent !

It’s all fine and working well. My doubt is how I could access the redis’ terminal as I’m able to access the main app’s one hosted on Fly. Maybe it’s only possible locally, because it’s setup to run at 6379/tcp and not 6379:6379?

I’m still not sure how you’re running Redis - is it running within the main app container? It won’t be accessible anywhere other than locally unless you expose it in fly.toml.

Understood. To be able to explore it I must expose it in fly.toml. Thanks!

Bear in mind that if you expose it then it’ll be publicly accessible! If you just want to be able to access it without publicly exposing it, you can either fly ssh console into the machine or fly proxy 6379.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.