masschallenge/impact-api

View on GitHub
docker-compose.yml

Summary

Maintainability
Test Coverage
version: '3'
services:
  # Redis
  redis:
    build:
      dockerfile: Dockerfile.redis
      context: .
    volumes:
      - ./redis:/var/lib/redis/data
    ports:
      - "6379:6379"
  assets:
    image: donnex/assets
    ports:
      - "35729:35729"
    volumes:
      - ./assets/gulpfile.js:/gulp/gulpfile.js:ro
      - ./web/impact/sass:/gulp/sass:cached
      - ./web/impact/static/css:/gulp/css:cached
      - ./web/impact/static/js:/gulp/js:cached
  front-end:
    build:
      dockerfile: dev.Dockerfile
      context: ../front-end
    volumes:
      - ../front-end/dist:/usr/src/app/dist
      - ../front-end/src:/usr/src/app/src
      - ${FRONTEND_PATH}/.env:/usr/src/app/.env
    ports:
      - "1234:1234"
  # Web python
  web:
    build: ./web
    ports:
      - "80:80"
      - "443:443"
      - "8000:8000"
    expose:
      - "80"
      - "443"
    volumes:
      - ./web/impact:/wwwroot:cached
      - ../django-accelerator:/packages/src/django-accelerator:cached
      - ../front-end/dist:/wwwroot/static/front-end-dist:cached
      - ./db_cache:/db_cache:cached
      - ./web/nginx/nginx.conf:/etc/nginx/nginx.conf:cached
      - ./web/impact/media:/media:cached
      - ./web/scripts/mysqlwait.sh:/usr/bin/mysqlwait.sh:cached
    depends_on:
      - front-end
      - assets
    links:
      - redis
    env_file:
      - .env
      - .dev.env
    user: root
  start_dependencies:
    image: "python:3.6"
    depends_on:
      - web
    links:
      - redis
      - web
    command: >
      /bin/bash -c "
      until $$(curl --output /dev/null --silent --head --fail http://web:8000); do
        echo \"BUILDING WEB...\"
        sleep 5
      done; echo \"WEB BUILD COMPLETE - visit http://localhost:8000 in a browser\";
      until $$(curl --output /dev/null --silent --head --fail http://front-end:1234); do
        echo \"BUILDING FRONTEND...\"
        sleep 5
      done; echo \"FRONTEND BUILD COMPLETE - visit http://localhost:1234 in a browser\";"


networks:
  default:
    external:
      name: impact-api_default