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

dockerization #2

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

dockerization #2

wants to merge 1 commit into from

Conversation

skord
Copy link

@skord skord commented Sep 19, 2014

Evidentally, you can't update a force-pushed PR. This is a copy of #1

  1. Uses the Phusion docker image as a base. Should you choose to merge to master, I'll set up an automated build on Dockerhub so whenever there is a push to master, the docker image gets built.
  2. Because it uses phusion's image, sidekiq and the web head are memory and process managed via init. The running container is isolated, getting in is a PITA without knowing what you're doing, getting out of the container is really, really hard.
  3. Proper supporting containers with persistence. All scripted to be setup. First run with bootstrap.sh, subsequent code pushes can be deployed with update.sh. Not a rolling restart since there's only one box.
  4. Gemfile and asset caching. Just changing a template? Don't rebuild the entire god damned thing, use the cached layer. Saves mucho time.

This also sets up something kinda cool for dev/testing/what-have-you. Should you choose, you can have a data-only container that houses the nginx config. The nginx config actually defines your environment, so what you'd do in that container is have multiple tagged branches of it... one for each environment. That way you could run

 docker run --name=rails -d -v /opt/crb_jobs/log:/home/app/crb_jobs/log \
           -p 80:80 \
           --link postgres:postgres \
           --link redis:redis \
           --link elasticsearch:elasticsearch \
           --volumes_from=nginx-config \
           --volume /home/app/crb_jobs /Users/darby/projects/crb_jobs \
           -e RAILS_ENV=production \
           -e DATABASE_URL=postgres://postgres@$PG_IP:5432/crb_jobs_production \
            columbusrb/crb_jobs:latest

And be able to use the container for dev. Anywho, throw it away, use it, whatever.

IMPORTANT NOTE: This uses the DATABASE_URL as an environmental to override what's in database.yml, so don't exclude or forget it.

PR Updated to bring the redis and es containers to initializer configurations. This allows a little bit more flexibility in upgrading/whathaveyou to those containers.

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.

None yet

1 participant