services:
  # postgres-db:
  #    image: kartoza/postgis:12.0
  #    ports:
  #       - 5432:5432
  #    volumes:
  #       - postgres_data:/var/lib/postgresql
  #       - ./custom-postgresql.conf:/etc/postgresql/12/main/postgresql.conf
  #    environment:
  #       - POSTGRES_USER=${POSTGRES_USER}
  #       - POSTGRES_PASS=${POSTGRES_PASS}
  #       - POSTGRES_DBNAME=${POSTGRES_DBNAME}
  #       - POSTGRES_MAX_CONNECTIONS=600

  #    restart: "on-failure"
  #    networks:
  #       - rog-api

  api:
    build:
      context: .
      dockerfile: Dockerfile.gdal
        #    command: python3 manage.py runserver 0.0.0.0:8100
    volumes:
      - .:/app
    ports:
      - 8000:8000
    env_file:
      - .env
    restart: "on-failure"
    networks:
      - rog-api

  supervisor-web:
      build:
        context: .
        dockerfile: Dockerfile.supervisor
      volumes:
        - type: bind
          source: ./supervisor/html
          target: /usr/share/nginx/html/supervisor
          read_only: true
        - type: bind
          source: ./supervisor/nginx/default.conf
          target: /etc/nginx/conf.d/default.conf
          read_only: true
        - type: volume
          source: static_volume
          target: /app/static
          read_only: true
        - type: volume
          source: nginx_logs
          target: /var/log/nginx
        - type: bind
          source: ./media
          target: /usr/share/nginx/html/media
      ports:
        - "8100:8100"
      depends_on:
        - api
      networks:
        - rog-api
      restart: always



networks:
  rog-api:
    driver: bridge

volumes:
  postgres_data:
  geoserver-data:
  static_volume:
  nginx_logs:
