migrate:
image: webgoal/standalone-migrations
volumes:
- ./db:/opt/migrations/db
As in the example you must have a 'db' folder in the same directory
development:
adapter: mysql2
encoding: utf8
database: database_development
username: user
password: pass
host: 192.168.1.2
production:
adapter: mysql2
encoding: utf8
database: database_production
username: user
password: pass
host: 192.168.1.3
docker-compose run db mysql -hdb -pmypass database_development < ./db/structure.sql
docker-compose run migrate rake db:new_migration name="migration_name"
docker-compose run migrate rake db:migrate
docker-compose run -e RAILS_ENV='production' migrate rake db:migrate