-
Notifications
You must be signed in to change notification settings - Fork 21
Docker
This is an expansion of what's on the Production wiki page.
docker build -t jolly_advisor .
docker pull postgres:latest
jolly_env.env
THE_JOLLY_ADVISOR_DATABASE_USERNAME=user
THE_JOLLY_ADVISOR_DATABASE_PASSWORD=password
THE_JOLLY_ADVISOR_DATABASE_HOST=jollypostgres
THE_JOLLY_ADVISOR_DATABASE_PORT=5432
RAILS_ENV=production
SECRET_KEY_BASE=LOLSECRET
RAILS_SERVE_STATIC_FILES=true
jolly_postgres_env.env
POSTGRES_PASSWORD=password
POSTGRES_USER=user
docker run --rm --name jollypostgres --env-file=/full/path/to/jolly_postgres_env.env -v /full/path/to/postgres/save/location:/var/lib/postgresql/data/ postgres
docker exec jollypostgres su postgres sh -c "createdb the_jolly_advisor_production"
docker run --rm --link jollypostgres:jollypostgres --env-file=/full/path/to/jolly_env.env jolly_advisor rake db:migrate
docker run --rm --link jollypostgres:jollypostgres --env-file=/full/path/to/jolly_env.env jolly_advisor rake assets:precompile
docker run --link jollypostgres:jollypostgres --rm ---env-file=/full/path/to/jolly_env.env jolly_advisor rake import:data_dump
docker run --rm --name jolly --link jollypostgres:jollypostgres -p 3000:3000 --env-file=/full/path/to/jolly_env.env jolly_advisor
If docker --version
>= 1.3.0, you can enter a running container with docker exec $container_name
.