ohtu2021-kvantti/WebMark

View on GitHub
docker-compose.yml

Summary

Maintainability
Test Coverage
# Configuration for development (dev server and hot reloading)
version: "3.7"

services:
  db:
    image: postgres:13.1
    environment:
      - POSTGRES_DB=${DATABASE_NAME-postgres}
      - POSTGRES_USER=${DATABASE_USER-postgres}
      - POSTGRES_PASSWORD=${DATABASE_PASSWORD-postgres}
    container_name: db

  rabbitmq:
    image: rabbitmq:3.8
    container_name: rabbitmq

  web:
    build:
      context: .
      args:
        - LIBMARK_VERSION=e3cc4bbe82a44d94edac2d9eba7455c2d12cfe01
    environment:
      - DATABASE_NAME=${DATABASE_NAME-postgres}
      - DATABASE_USER=${DATABASE_USER-postgres}
      - DATABASE_PASSWORD=${DATABASE_PASSWORD-postgres}
      - DATABASE_HOST=db
      - DATABASE_PORT=5432
      - BROKER_URL=pyamqp://guest@rabbitmq//
      - SECRET_KEY=${SECRET_KEY-secret}
      - API_KEY=${API_KEY-secret}
      - DEBUG=True
    command: sh -c "
      python manage.py makemigrations WebCLI &&
      python manage.py migrate --noinput &&
      python manage.py runserver 0.0.0.0:8000"
    container_name: web
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    depends_on:
      - db

  benchmark:
    build:
      context: BenchMark/
      args:
        - LIBMARK_VERSION=21f0ffa0a29c5ae76ca90fdee326e9b4710cfe54
    command: conda run --no-capture-output -n benchmark
             watchmedo auto-restart --directory=./ --pattern=*.py --recursive
             -- celery -A benchmark worker -l info
    container_name: benchmark
    volumes:
      - ./BenchMark:/code
    environment:
      - BROKER_URL=pyamqp://guest@rabbitmq//
      - DJANGO_API_URL=http://web:8000/handleResult
      - API_KEY=${API_KEY-secret}