version: '3.8'

services:
  frontend-staging:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    container_name: autonet-frontend-staging
    ports:
      - "3001:3000"
    environment:
      - NODE_ENV=staging
      - NEXT_PUBLIC_API_URL=http://192.168.0.202:8001
    depends_on:
      - backend-staging
    restart: unless-stopped
    networks:
      - autonet-staging

  backend-staging:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: autonet-backend-staging
    ports:
      - "8001:8000"
    environment:
      - ENV=staging
      - DATABASE_URL=sqlite:///./autonet_staging.db
    volumes:
      - ./backend/uploads:/app/uploads
      - backend-staging-data:/app/data
      - ./backend/.env:/app/.env:ro
    restart: unless-stopped
    networks:
      - autonet-staging

networks:
  autonet-staging:
    name: autonet-staging-network

volumes:
  backend-staging-data:
    name: autonet-backend-staging-data
