-
Notifications
You must be signed in to change notification settings - Fork 14
Use env vars to set port; respect env vars in docker compose #6085
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,7 @@ FileUtils.chdir APP_ROOT do | |
| system! "yarn install" | ||
|
|
||
| puts "\n== Starting database ==" | ||
| system! "brew services stop postgresql" | ||
| system! "docker compose pull db" | ||
| system! "docker compose up --wait -d db" | ||
|
Comment on lines
+51
to
52
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer stopping Postgres because other projects might be using it. Should be sufficient to just start on another port. This |
||
|
|
||
| puts "\n== Preparing database ==" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,8 +16,6 @@ deploy_default: &deploy_default | |
| development: | ||
| <<: *local_default | ||
| database: vita-min_development | ||
| username: <%= ENV.fetch("RAILS_DB_USERNAME", 'postgres') %> | ||
| password: <%= ENV.fetch("RAILS_DB_PASSWORD", 'password') %> | ||
|
Comment on lines
-19
to
-20
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need this after using
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what "shouldn't have made it in" means here & just want to double check to make sure I'm not missing something - these lines were added by Melanie when she added the docker compose file
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added these lines in my last merge. They're unnecessary because they only matter in development and we're already using
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my bad - i was looking at the very similar lines 7-8 up in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does the same rationale for removing these lines apply now to those ones?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'm inclined to leave them alone. Ports rarely change and |
||
|
|
||
| # Warning: The database defined as "test" will be erased and | ||
| # re-generated from your development database when you run "rake". | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,12 +7,12 @@ services: | |
| image: postgis/postgis:13-3.4-alpine | ||
| user: postgres | ||
| ports: | ||
| - 127.0.0.1:5432:5432 | ||
| - 127.0.0.1:${RAILS_DB_PORT:-5432}:5432 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The unusual notation of |
||
| volumes: | ||
| - database:/var/lib/postgresql/data | ||
| environment: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: password | ||
| POSTGRES_USER: ${RAILS_DB_USERNAME:-postgres} | ||
| POSTGRES_PASSWORD: ${RAILS_DB_PASSWORD:-password} | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready", "-d", "postgres"] | ||
| interval: 30s | ||
|
|
@@ -31,11 +31,11 @@ services: | |
| web: | ||
| condition: service_healthy | ||
| environment: | ||
| - DOCKER=true | ||
| - RAILS_DB_HOST=db | ||
| - RAILS_DB_USERNAME=postgres | ||
| - RAILS_DB_PORT=5432 | ||
| - RAILS_DB_PASSWORD=password | ||
| DOCKER: true | ||
| RAILS_DB_HOST: db | ||
| RAILS_DB_USERNAME: ${RAILS_DB_USERNAME:-postgres} | ||
| RAILS_DB_PORT: ${RAILS_DB_PORT:-5432} | ||
| RAILS_DB_PASSWORD: ${RAILS_DB_PASSWORD:-password} | ||
| web: | ||
| container_name: web | ||
| build: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be that we want to remove this line. We require binaries though. We can get them from
libpqinstead but it requires a modification ofPATHwhich we don't have a standard tool to do. I recommendmiseif we proceed down that path.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is as reasonable as anything else if there isn't a brew formula for the exact binaries we need.