version: '3.8' services: db: image: postgres:15-alpine environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: inventory_db ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 backend: build: ./backend ports: - "8000:8000" environment: DATABASE_URL: postgresql://postgres:postgres@db:5432/inventory_db CORS_ORIGINS: http://localhost:3000,http://localhost depends_on: db: condition: service_healthy frontend: build: context: ./frontend args: VITE_API_URL: http://localhost:8000 ports: - "3000:80" depends_on: - backend volumes: pgdata: