Skip to content

Instantly share code, notes, and snippets.

@wshihadeh
Created February 16, 2020 09:26
Show Gist options
  • Save wshihadeh/50b8b5aee396d555246840a7a392dbcf to your computer and use it in GitHub Desktop.
Save wshihadeh/50b8b5aee396d555246840a7a392dbcf to your computer and use it in GitHub Desktop.
Rails blog Stack
version: '3.7'
networks:
traefik:
external: true
volumes:
db_data:
services:
mysql:
image: mysql:5.7
command: mysqld --general-log=1 --general-log-file=/var/log/mysql/general-log.log
deploy:
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 10s
order: start-first
parallelism: 1
rollback_config:
parallelism: 0
order: stop-first
logging:
driver: json-file
options:
'max-size': '10m'
'max-file': '5'
networks:
- traefik
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: dummy
MYSQL_DATABASE: rails_blog_production
rails_blog_web:
image: wshihadeh/rails_blog:demo-v1
command: 'web'
deploy:
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 10s
order: start-first
parallelism: 1
rollback_config:
parallelism: 0
order: stop-first
logging:
driver: json-file
options:
'max-size': '10m'
'max-file': '5'
networks:
- traefik
depends_on:
- mysql
environment:
DATABASE_URL: mysql2://root:dummy@mysql/rails_blog_production
RAILS_SERVE_STATIC_FILES: 'true'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment