Skip to content

Change default ports for Redis, PostgreSQL and ElasticSearch #1139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

AlexWayfer
Copy link
Contributor

They already can be run in background, so docker compose up can fail.

They already can be run in background, so `docker compose up` can fail.
@AlexWayfer
Copy link
Contributor Author

Probably we should not expose dependencies ports at all?

@@ -43,7 +43,7 @@

# Use a different cache store in production.
config.cache_store = :redis_cache_store, {
url: ENV.fetch("REDIS_CACHE_URL") { "redis://localhost:6379/1" },
url: ENV.fetch("REDIS_CACHE_URL") { "redis://localhost:6381/1" },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you want to change production ports

@@ -6,7 +6,7 @@ test:

production:
adapter: redis
url: <%= ENV.fetch("REDIS_SESSION_URL") { "redis://localhost:6379/1" } %>
url: <%= ENV.fetch("REDIS_SESSION_URL") { "redis://localhost:6381/1" } %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you want to change production ports

@natematykiewicz
Copy link
Contributor

Probably we should not expose dependencies ports at all?

What do you mean?

@AlexWayfer
Copy link
Contributor Author

AlexWayfer commented Jun 22, 2022

Probably we should not expose dependencies ports at all?

What do you mean?

As I know, we can delete these ports exposing and they (services) will be available under nicknames let's say (like redis:6379, etc.) if they've started by docker-compose.

@AlexWayfer
Copy link
Contributor Author

But… as I see, the web application is not in Docker (including compose). I think we should move at this direction. But I know 0 about production.

And, at this moment. I'm unable to work on RubyAPI just because it's trying to expose (default) ports which are already bind (by system packages).

@AlexWayfer AlexWayfer marked this pull request as draft June 22, 2022 23:46
@natematykiewicz
Copy link
Contributor

Production is Heroku, using the Procfile and whatever ENV vars @colby-swandale has configured. I wouldn't change any production configs. Colby configures those.

@AlexWayfer
Copy link
Contributor Author

Heroku can deal with docker-compose: https://devcenter.heroku.com/articles/local-development-with-docker-compose

Like, we need for a service like web there.

I'll wait for some comments from @colby-swandale, no problem.

@colby-swandale
Copy link
Member

colby-swandale commented Jun 23, 2022

👋🏻 Docker was mostly just a personal preference when I started the project; it's easy to document & start/reset with a few simple commands. Though Docker is the "blessed" method that Ruby API will work with out of the box, If you prefer your OS package manager, that's perfectly fine and should work without issue. I like happy developers over enforcing ways of working.

I don't desire a web service in Docker Compose. I always run rails/node/python applications outside Docker, so adding that service will be disruptive when I run docker compose up. I will happily support a docker-compose.web.yml file with a web service for people who prefer to run Rails inside Docker.

@AlexWayfer
Copy link
Contributor Author

I don't desire a web service in Docker Compose. I always run rails/node/python applications outside Docker, so adding that service will be disruptive when I run docker compose up.

May I know why? Just curious.

I will happily support a docker-compose.web.yml file with a web service for people who prefer to run Rails inside Docker.

Sounds like not a difficult change, I'll try.

@AlexWayfer
Copy link
Contributor Author

I will happily support a docker-compose.web.yml file with a web service for people who prefer to run Rails inside Docker.

Sounds like not a difficult change, I'll try.

Update: it'll require changes like this:

-  url: <%= ENV.fetch("REDIS_SESSION_URL") { "redis://localhost:6379/1" } %>
+  url: <%= ENV.fetch("REDIS_SESSION_URL") { "redis://redis:6379/1" } %>

And I don't think it'll work for you.

@AlexWayfer AlexWayfer mentioned this pull request Jun 25, 2022
@colby-swandale
Copy link
Member

I'm closing this PR for now, but feel free to open a new PR with rebase if you would like to see this merged in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants