version: '3.4' services: db: environment: - MYSQL_USER=foreman - MYSQL_PASSWORD=foreman - MYSQL_DATABASE=foreman - MYSQL_DATADIR_ACTION=upgrade-auto hostname: db.example.com image: centos/mariadb-102-centos7 ports: - 3306 restart: always healthcheck: test: ["CMD-SHELL", "nc -z 127.0.0.1 3306 || exit 1"] interval: 30s timeout: 30s retries: 3 volumes: - db:/var/lib/mysql/data app: &app_base image: quay.io/foreman/foreman:develop command: bundle exec bin/rails server -b 0.0.0.0 build: context: . environment: - DATABASE_URL=mysql2://foreman:foreman@db:3306/foreman - RAILS_MAX_THREADS=5 - RAILS_ENV=production - FOREMAN_FQDN=foreman.example.com - FOREMAN_DOMAIN=example.com - FOREMAN_RAILS_CACHE_STORE_TYPE=redis - FOREMAN_RAILS_CACHE_STORE_URLS=redis://redis:6379/0 hostname: foreman.example.com links: - db - redis ports: - "${MY_DOCKER_IP:-127.0.0.1}:3000:3000" - "${MY_DOCKER_IP:-127.0.0.1}:5910-5930:5910-5930" restart: always healthcheck: test: ["CMD-SHELL", "nc -z 127.0.0.1 3000 || exit 1"] interval: 5m start_period: 1m worker: <<: *app_base command: bundle exec rake dynflow:executor hostname: worker.example.com ports: - 9999 healthcheck: test: "ps ax | grep -v grep | grep dynflow_executor" interval: 1m start_period: 1m redis: image: redis volumes: db: