Skip to content
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

Fixes #38274 - Updated docker-compose.yml that fixes the issues outli… #10472

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

brandonhon
Copy link

…ned in bug.

Fixes #38274 - Updated docker-compose.yml that fixes the issues outlined in bug.
https://projects.theforeman.org/issues/38274

Fixes app services exiting with error multiple PG::UndefinedTable: errors by moving the database creation to the app service. The database is dropped (if exists), recreated and configured by foreman to ensure all tables are created successfully.

environment:
- POSTGRES_USER=foreman
Copy link
Member

Choose a reason for hiding this comment

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

I still like the dedicated user just for Foreman. That's closer to what we have in production

test: ["CMD-SHELL", "nc -z 127.0.0.1 5432 || exit 1"]
interval: 30s
timeout: 30s
test: ["CMD-SHELL", "pg_isready"]
Copy link
Member

Choose a reason for hiding this comment

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

TIL: pg_isready exists. Nice

- /bin/bash
- -c
- |
bundle exec bin/rake db:reset
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this wipe the DB on every restart? I don't like that if I'm honest. Too easy to lose work.

- RAILS_MAX_THREADS=5
- RAILS_ENV=production
- FOREMAN_FQDN=foreman.example.com
- FOREMAN_DOMAIN=example.com
- FOREMAN_RAILS_CACHE_STORE_TYPE=redis
- FOREMAN_RAILS_CACHE_STORE_URLS=redis://redis-cache:6379/0
- DYNFLOW_REDIS_URL=redis://redis-tasks:6379/0
- REDIS_PROVIDER=DYNFLOW_REDIS_URL
- REDIS_PROVIDER=$DYNFLOW_REDIS_URL
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is right. Looking at https://github.com/sidekiq/sidekiq/blob/77c6052e4d2d9ccc26457b4a2d629c33a9456664/lib/sidekiq/redis_connection.rb#L93-L98 it should be the name of the env var that contains the real URL.

hostname: orchestrator.example.com
ports: []
## Not required
# orchestrator:
Copy link
Member

Choose a reason for hiding this comment

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

This and the worker are needed for tasking.

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.

2 participants