version: '3'

services:
  frontend:
    container_name: frontend
    image: frontend
    build:
      context: frontend
    volumes:
      - ./frontend/:/app/
      - node_modules:/app/node_modules

    environment:
      - WATCHPACK_POLLING=true          # Enable react dev server auto-reload
  
  backend:
    container_name: backend
    image: backend
    build:
      context: backend
    volumes:
      - ./backend/src/:/app/
    environment:
      - WATCHFILES_FORCE_POLLING=true   # Enable uvicorn auto-reload
    env_file:
      - ./backend/envs/dev.env
  
  minio:
    container_name: minio
    image: minio/minio
    command:
      - server
      - /data
      - --console-address
      - ":9001"
    volumes:
      - minio_storage:/data
  nginx:
    image: nginx:latest
    container_name: nginx
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./nginx/cert/:/etc/nginx/cert
    ports:
      - 8443:443
      - 8080:80
      - 9000:9000
      - 9001:9001

volumes:
  node_modules:
  minio_storage: