zxc23/dcss-scoreboard

View on GitHub
docker-compose.yml

Summary

Maintainability
Test Coverage
version: "3.6"

volumes:
  website:

services:
  scoreboard_api:
    build: .
    command: /scoreboard/loader.py --urlbase ''
    volumes:
      - type: bind
        # Relative to docker-compose.yml's location
        source: ./
        target: /scoreboard
      # - type: volume
      #   source: website
      #   target: /website
    depends_on:
      - postgres
    links:
      - postgres
    environment:
      PYTHONUNBUFFERED: 1
      SCOREBOARD_DATABASE: postgres
      SCOREBOARD_SCOREBOARD_DB_USERNAME: postgres
      SCOREBOARD_DB_PASSWORD: scoreboardpassword
      SCOREBOARD_DB_HOST: postgres
      SCOREBOARD_GAME_API: http://crawlapi.mooo.com/event
      # SCOREBOARD_WEBSITE_PATH: /website
      SCOREBOARD_SKIP_SCORING: 1
      SCOREBOARD_SKIP_WEBSITE: 1
  scoreboard_website:
    build: .
    command: /scoreboard/loader.py --urlbase '/'
    volumes:
      - type: bind
        # Relative to docker-compose.yml's location
        source: ./
        target: /scoreboard
      - type: volume
        source: website
        target: /website
    depends_on:
      - postgres
    links:
      - postgres
    environment:
      PYTHONUNBUFFERED: 1
      SCOREBOARD_DATABASE: postgres
      SCOREBOARD_SCOREBOARD_DB_USERNAME: postgres
      SCOREBOARD_DB_PASSWORD: scoreboardpassword
      SCOREBOARD_DB_HOST: postgres
      # SCOREBOARD_GAME_API: http://crawlapi.mooo.com/event
      SCOREBOARD_WEBSITE_PATH: /website
      SCOREBOARD_SKIP_IMPORT: 1
      SCOREBOARD_SKIP_DB_SETUP: 1
    restart: always
  postgres:
    image: postgres:10-alpine
    environment:
      POSTGRES_PASSWORD: scoreboardpassword
      POSTGRES_DB: scoreboard
    ports:
      - "5432:5432"
  nginx:
    image: nginx:stable-alpine
    ports:
     - "8000:80"
    volumes:
      - type: volume
        source: website
        target: /usr/share/nginx/html
        read_only: true