version: '3.8' services: # Frontend React application frontend: build: context: ./frontend dockerfile: Dockerfile ports: - "3000:3000" volumes: - ./frontend:/app - /app/node_modules depends_on: - backend environment: - VITE_API_URL=http://localhost:4000/api - VITE_ENVIRONMENT=beta networks: - app-network # Backend Express server backend: build: context: ./backend dockerfile: Dockerfile env_file: - ./backend/.env ports: - "4000:4000" volumes: - ./backend:/app - /app/node_modules - ./backend/public/uploads:/app/public/uploads # Persist uploads depends_on: db: condition: service_healthy networks: - app-network # PostgreSQL Database db: image: postgres:14-alpine ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data - ./db/init:/docker-entrypoint-initdb.d env_file: - ./backend/.env restart: always healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 start_period: 10s networks: - app-network volumes: postgres_data: networks: app-network: driver: bridge