version: "2.2"
   
services:
  web:
    restart: always
    build:
      context: ./app
      dockerfile: Dockerfile.prod
    command: ["gunicorn", "BIFproject.wsgi:application", "--bind", "0.0.0.0:8000"]
    mem_limit: 1024m
    mem_reservation: 512m
    cpus: 0.5
    volumes:
      - static_volume:/home/app/web/static
      - ./app/staticfiles:/home/app/web/staticfiles
    expose:
      - 8000
    env_file:
      - ./.env.prod
  nginx:
    restart: always
    build: ./nginx
    mem_limit: 1024m
    mem_reservation: 512m
    cpus: 0.5
    volumes:
      - static_volume:/home/app/web/static
    ports:
      - 8000:80
    depends_on:
      - web

volumes:
  static_volume:
