services:
  backend:
    build:
      context: ./ems-backend
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
    volumes:
      - ./ems-backend/json-db:/app/json-db
      - ./ems-backend/uploads:/app/uploads
    environment:
      APP_BASE_URL: ${APP_BASE_URL:-http://localhost:5173}
      TOKEN_SIGNING_KEY: ${TOKEN_SIGNING_KEY:-}
      JWT_SECRET: ${JWT_SECRET:-}
      VOLCANO_API_KEY: ${VOLCANO_API_KEY:-}
      SPRING_MAIL_USERNAME: ${SPRING_MAIL_USERNAME:-}
      SPRING_MAIL_PASSWORD: ${SPRING_MAIL_PASSWORD:-}
  frontend:
    build:
      context: ./ems-frontend
      dockerfile: Dockerfile
      args:
        VITE_API_BASE_URL: /api
    ports:
      - "5173:80"
    depends_on:
      - backend
