Skip to content

Instantly share code, notes, and snippets.

@maxfierke
Created September 26, 2015 21:07
Show Gist options
  • Save maxfierke/6b3e373ad595627b0558 to your computer and use it in GitHub Desktop.
Save maxfierke/6b3e373ad595627b0558 to your computer and use it in GitHub Desktop.
Docker-compose roles reusing same image
db:
image: postgres:9.4.1
ports:
- "5432:5432"
redis:
image: redis
worker:
build: .
command: bundle exec sidekiq
environment:
RAILS_ENV: development
RESUMIS_CANONICAL_HOST: resumis-docker.dev
RESUMIS_TENANCY_MODE: single
DATABASE_URL: postgres://postgres@db/resumis_development
REDIS_URL: redis://redis:6379/1
links:
- db
- redis
volumes:
- .:/resumis
web:
build: .
command: bin/rails server --port 3000 --binding 0.0.0.0
environment:
RAILS_ENV: development
RESUMIS_CANONICAL_HOST: resumis-docker.dev
RESUMIS_TENANCY_MODE: single
DATABASE_URL: postgres://postgres@db/resumis_development
REDIS_URL: redis://redis:6379/1
ports:
- "3000:3000"
links:
- db
- redis
volumes:
- .:/resumis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment