Skip to content

Instantly share code, notes, and snippets.

@LuisErnestoZamb
Created November 16, 2018 16:42
Show Gist options
  • Save LuisErnestoZamb/b2bd92c2308b53b867e2a69ba6337d05 to your computer and use it in GitHub Desktop.
Save LuisErnestoZamb/b2bd92c2308b53b867e2a69ba6337d05 to your computer and use it in GitHub Desktop.
Adding TDD on rails + docker
version: '2'
services:
webtest:
build:
context: .
dockerfile: doc/docker-conf/web/Dockerfile-test
volumes:
- .:/usr/src/app
command: bash -c "bundle check || bundle install; rm -f /usr/src/app/tmp/pids/server.pid ; rails s -p 3000 -b 0.0.0.0"
environment:
- RACK_ENV=test
- RAILS_ENV=test
- REDIS_HOST=redis
- REDIS_PORT=6379
links:
- redis_db:redis
ports:
- '8082:3000'
expose:
- "8082"
redis_db:
image: 'redis:3.2.3-alpine'
command: redis-server
workertest:
build:
context: .
dockerfile: doc/docker-conf/sidekiq/Dockerfile-test
volumes:
- .:/usr/src/sidekiq
command: bash -c "bundle check || bundle install; rm -f /usr/src/app/tmp/pids/sidekiq.pid; bundle exec sidekiq"
links:
- redis_db:redis
environment:
- email_complain=example@example.com
- RACK_ENV=test
- RAILS_ENV=test
- REDIS_HOST=redis
- REDIS_PORT=6379
@LuisErnestoZamb
Copy link
Author

Later execute:
docker-compose -f docker-compose-test.yml exec workertest bundle exec guard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment