Skip to content

Instantly share code, notes, and snippets.

@dadicool
Created September 12, 2018 16:02
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 dadicool/a8549f89c7cf975c53665c565049e9cd to your computer and use it in GitHub Desktop.
Save dadicool/a8549f89c7cf975c53665c565049e9cd to your computer and use it in GitHub Desktop.
docker-compose blog post example
version: '2'
services:
web:
image: lifen/railsApp:${VERSION}
mem_limit: 1024m
ports:
- "3000:3000"
env_file:
- .env.web.production
volumes:
- "LOCAL_PATH_TO_STORAGE:/myapp/uploads"
- "LOCAL_PATH_TO_STORAGE:/myapp/log"
command: 'bundle exec rails server -b "0.0.0.0"'
restart: unless-stopped
logging:
driver: syslog
options:
tag: railsApp-web/json
syslog-facility: local0
worker:
image: lifen/railsApp:${VERSION}
mem_limit: 1536m
env_file:
- .env.web.production
volumes:
- "OCAL_PATH_TO_STORAGE:/myapp/log"
command: 'bundle exec sidekiq -C config/sidekiq.yml'
restart: unless-stopped
logging:
driver: syslog
options:
tag: railsApp-worker/json
syslog-facility: local0
redis:
image: redis:3-alpine
mem_limit: 128m
ports:
- "16379:6379"
volumes:
- "LOCAL_PATH_TO_REDIS_STORAGE:/data"
restart: unless-stopped
logging:
driver: syslog
options:
tag: railsAppA_redis
syslog-facility: local0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment