services: db: image: postgres:16 restart: unless-stopped environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: food_prices volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 backend: build: ./backend restart: unless-stopped depends_on: db: condition: service_healthy environment: DATABASE_URL: postgresql://postgres:postgres@db:5432/food_prices ports: - "8000:8000" volumes: - ./backend:/app frontend: build: ./frontend restart: unless-stopped depends_on: - backend environment: NEXT_PUBLIC_API_URL: http://localhost:8000 ports: - "3000:3000" volumes: - ./frontend/src:/app/src - ./frontend/public:/app/public - frontend_node_modules:/app/node_modules - frontend_next:/app/.next volumes: postgres_data: frontend_node_modules: frontend_next: