Skip to content

Instantly share code, notes, and snippets.

@olkeene
Last active January 18, 2017 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olkeene/3b95d961f5dc5bce86e077b037369db4 to your computer and use it in GitHub Desktop.
Save olkeene/3b95d961f5dc5bce86e077b037369db4 to your computer and use it in GitHub Desktop.
# .docker/.env
REDIS_HOST=redis
MONGO_HOST=mongo
# .docker/db.env
MYSQL_ROOT_USER=root
MYSQL_ROOT_PASSWORD=password
MYSQL_USER=root
MYSQL_PASSWORD=password
MYSQL_HOST=db
MYSQL_DATABASE=app_development
version: '2'
services:
app:
build: .
command: ./bin/startup.sh
volumes:
- .:/app
- bundle:/bundle
ports:
- '3000:3000'
- '4000:4000'
env_file:
- ./.docker/db.env
- ./.docker/.env
links:
- db
- redis
- mongo
db:
image: mysql:5.7
ports:
- 3306
env_file:
- ./.docker/db.env
volumes:
- mysql:/var/lib/mysql
redis:
image: redis:latest
volumes:
- redis:/data
mongo:
image: mongo
volumes:
- mongo:/data/db
volumes:
bundle:
mysql:
redis:
mongo:
web: bundle exec rails s -b 0.0.0.0 -p 3000 -e ${RACK_ENV:-development}
react: npm start
resque: QUEUE=... bundle exec rake resque:work
resque_scheduler: bundle exec rake resque:scheduler
sphinx: bundle exec rake ts:start NODETACH=true
....
#!/bin/bash
# tells the bash script to exit whenever anything returns a non-zero return value.
set -e
./bin/wait-for-mysql.sh
# echo "[INFO] Precreate databases..."
# rake db:version || bundle exec rake db:setup
# echo "[INFO] Running db:migrate..."
# rake db:migrate
bundle exec foreman start -f Procfile.docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment