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

Docker default rails default startup should run rails s. #88

Open
chaoticbear opened this issue Sep 29, 2017 · 2 comments
Open

Docker default rails default startup should run rails s. #88

chaoticbear opened this issue Sep 29, 2017 · 2 comments
Assignees

Comments

@chaoticbear
Copy link
Collaborator

Current default command in docker-compose is bash -c 'bundle install --no-deployment && rails db:migrate && rails s'

Behavior should be:

  1. docker-compose up
  2. everything spins up, rails s command sent
  3. likely there are failures on first run
  4. docker-compose run rails bundle install (if needed)
  5. docker-compose run rake db:create (if needed)
  6. docker-compose run rake db:migrate (if needed)
@chaoticbear chaoticbear self-assigned this Sep 29, 2017
@chaoticbear
Copy link
Collaborator Author

@elskwid @phlipper Do you agree with this? I'm trying to figure out the best start up behavior for the container. I think it shouldn't run bundle install every time it starts.

@phlipper
Copy link
Contributor

@joshfleming personally I like a pattern where:

  • ENTRYPOINT is bundle exec by default
  • CMD is rails server by default (or possibly just rails with compose handling the service bits)
  • bundle install is handled during docker build vs. manually
  • docker-compose run --rm app rails db:setup is a fine one-time setup, possibly automated via a project bootstrap step (e.g. bin/bootstrap.sh) with other required setup steps

I'm happy to contribute the Dockerfile bits over in renocollective/docker-rails-dev and the compose bits in here as needed.

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

No branches or pull requests

2 participants