rubyforgood/babywearing

View on GitHub
docker/docker-stack.yml

Summary

Maintainability
Test Coverage
version: '3'
services:

  app:
    image: babywearing.azurecr.io/babywearing:prod
    ports:
      - "3000:3000"
    env_file:
      - $TRAVIS_BUILD_DIR/docker/env/production/database
      - $TRAVIS_BUILD_DIR/docker/env/production/app
    depends_on:
      - db-migrator

  database:
    image: postgres:11.6
    env_file:
      - $TRAVIS_BUILD_DIR/docker/env/production/database
    volumes:
      - babywearing_pg:/var/lib/postgresql/data

  db-migrator:
    image: babywearing.azurecr.io/babywearing:prod
    command: >
      sh -c "./wait-for --timeout=300 database:5432 -- bin/rails db:migrate &&
              bin/rails db:seed"
    env_file:
      - $TRAVIS_BUILD_DIR/docker/env/production/database
      - $TRAVIS_BUILD_DIR/docker/env/production/app
    deploy:
      restart_policy:
        condition: none
    depends_on:
      - database

  web:
    image: babywearing.azurecr.io/nginx:prod
    env_file:
      - $TRAVIS_BUILD_DIR/docker/env/production/web
    ports:
      - "80:80"
    depends_on:
      - app

volumes:
  babywearing_pg: