version: '3'

volumes:
  scoop_ca_local_postgres_data: {}
  scoop_ca_local_postgres_data_backups: {}

services:
  django:
    build:
      context: .
      dockerfile: ./compose/local/django/Dockerfile
    image: scoop_ca_local_django
    container_name: scoop_ca_local_django
    depends_on:
      - postgres
    volumes:
      - .:/app:z
    env_file:
      - ./.envs/.local/.django
      - ./.envs/.local/.postgres
    ports:
      - '8000:8000'
    command: /start

  postgres:
    build:
      context: .
      dockerfile: ./compose/production/postgres/Dockerfile
    image: scoop_ca_production_postgres
    container_name: scoop_ca_local_postgres
    volumes:
      - scoop_ca_local_postgres_data:/var/lib/postgresql/data
      - scoop_ca_local_postgres_data_backups:/backups
    env_file:
      - ./.envs/.local/.postgres

  docs:
    image: scoop_ca_local_docs
    container_name: scoop_ca_local_docs
    build:
      context: .
      dockerfile: ./compose/local/docs/Dockerfile
    env_file:
      - ./.envs/.local/.django
    volumes:
      - ./docs:/docs:z
      - ./config:/app/config:z
      - ./scoop_ca:/app/scoop_ca:z
    ports:
      - '9000:9000'
    command: /start-docs
