version: '3'

services:
  db:
    image: postgres:alpine
    environment:
      - POSTGRES_DB=oss-dashboard
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    volumes:
      - oss-dashboard-postgres:/var/lib/postgresql/data
    networks:
      - db
  dashboard:
    build:
      context: ./
      args:
        - http_proxy
        - https_proxy
    environment:
      - GH_ACCESS_TOKEN=
      - OCTOKIT_API_ENDPOINT= # if you use oss-dashboard to GitHub Enterprise, specify GHE api endpoint (ex. https://github.mycompany.com/api/v3)
    entrypoint: /wait-for db:5432 -t 10 -- bundle exec ruby
    command: refresh-dashboard.rb config-dashboard.yaml
    volumes:
      - ./config-dashboard.yaml:/oss-dashboard/config-dashboard.yaml
      # - ./config-github.yaml:/oss-dashboard/config-github.yaml
      - ./data:/oss-dashboard/data
      - ./html:/oss-dashboard/html
    networks:
      - db

networks:
  db:

volumes:
  oss-dashboard-postgres:

version: '3'

services:
  db:
    image: postgres:alpine
    environment:
      - POSTGRES_DB=oss-dashboard
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    volumes:
      - oss-dashboard-postgres:/var/lib/postgresql/data
    networks:
      - db
  dashboard:
    build:
      context: ./
      args:
        - http_proxy
        - https_proxy
    environment:
      - GH_ACCESS_TOKEN
      - OCTOKIT_API_ENDPOINT # if you use oss-dashboard to GitHub Enterprise, specify GHE api endpoint (ex. https://github.mycompany.com/api/v3)
    entrypoint: /wait-for db:5432 -t 10 -- bundle exec ruby
    command: refresh-dashboard.rb config-dashboard.yaml
    volumes:
      - ./config-dashboard.yaml:/oss-dashboard/config-dashboard.yaml
      # - ./config-github.yaml:/oss-dashboard/config-github.yaml
      - ./data:/oss-dashboard/data
      - ./html:/oss-dashboard/html
    networks:
      - db

networks:
  db:

volumes:
  oss-dashboard-postgres:

Use sane environment defaults for GitHub access.
Use sane environment defaults for GitHub access.
