version: '3.8' services: # PostgreSQL Database db: image: postgres:15-alpine container_name: landvex-db environment: POSTGRES_USER: landvex POSTGRES_PASSWORD: ${DB_PASSWORD:-landvex_dev} POSTGRES_DB: landvex_admin volumes: - postgres_data:/var/lib/postgresql/data - ./backend/alembic/init.sql:/docker-entrypoint-initdb.d/init.sql ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U landvex"] interval: 5s timeout: 5s retries: 5 # Redis Cache redis: image: redis:7-alpine container_name: landvex-redis ports: - "6379:6379" volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 5s retries: 5 # Backend API backend: build: context: ./backend dockerfile: Dockerfile container_name: landvex-backend environment: - DATABASE_URL=postgresql+asyncpg://landvex:${DB_PASSWORD:-landvex_dev}@db:5432/landvex_admin - REDIS_URL=redis://redis:6379/0 - SECRET_KEY=${SECRET_KEY:-dev-secret-key-change-in-production} - JWT_ALGORITHM=HS256 - ACCESS_TOKEN_EXPIRE_MINUTES=30 - REFRESH_TOKEN_EXPIRE_DAYS=7 - CORS_ORIGINS=http://localhost:5173,http://localhost:3000 - STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY} - STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET} ports: - "8000:8000" volumes: - ./backend:/app - /app/__pycache__ depends_on: db: condition: service_healthy redis: condition: service_healthy command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload # Frontend frontend: build: context: ./frontend dockerfile: Dockerfile container_name: landvex-frontend environment: - VITE_API_URL=http://localhost:8000/api/v1 ports: - "5173:5173" volumes: - ./frontend:/app - /app/node_modules depends_on: - backend command: npm run dev -- --host volumes: postgres_data: redis_data: