# Запуск из КОРНЯ проекта: docker compose --env-file .env up -d # Тогда .env подхватится и JWT_SECRET, Supabase и т.д. попадут в контейнеры. services: postgres: image: pgvector/pgvector:pg16 container_name: coursecraft-postgres restart: unless-stopped environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: coursecraft ports: - "5432:5432" volumes: - ./docker/data/postgres:/var/lib/postgresql/data - ./docker/init-scripts:/docker-entrypoint-initdb.d healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 redis: image: redis:7-alpine container_name: coursecraft-redis restart: unless-stopped ports: - "6395:6379" volumes: - ./docker/data/redis:/data command: redis-server --appendonly yes healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 meilisearch: image: getmeili/meilisearch:v1.6 container_name: coursecraft-meilisearch restart: unless-stopped environment: MEILI_MASTER_KEY: ${MEILISEARCH_API_KEY:-coursecraft-dev-key} MEILI_ENV: development ports: - "7700:7700" volumes: - ./docker/data/meilisearch:/meili_data healthcheck: test: ["CMD", "curl", "-f", "http://localhost:7700/health"] interval: 10s timeout: 5s retries: 5 api: build: context: . dockerfile: docker/Dockerfile.api container_name: coursecraft-api restart: unless-stopped env_file: .env environment: DATABASE_URL: postgresql://postgres:postgres@postgres:5432/coursecraft?schema=public REDIS_URL: redis://redis:6379 REDIS_HOST: redis REDIS_PORT: "6379" MEILISEARCH_HOST: http://meilisearch:7700 PORT: "3125" NODE_ENV: production JWT_SECRET: ${JWT_SECRET} SUPABASE_SERVICE_ROLE_KEY: ${SUPABASE_SERVICE_ROLE_KEY} NEXT_PUBLIC_SUPABASE_URL: ${NEXT_PUBLIC_SUPABASE_URL} NEXT_PUBLIC_SUPABASE_ANON_KEY: ${NEXT_PUBLIC_SUPABASE_ANON_KEY} ports: - "3125:3125" depends_on: postgres: { condition: service_healthy } redis: { condition: service_healthy } meilisearch: { condition: service_healthy } ai-service: build: context: . dockerfile: docker/Dockerfile.ai container_name: coursecraft-ai-service restart: unless-stopped env_file: .env environment: REDIS_URL: redis://redis:6379 REDIS_HOST: redis REDIS_PORT: "6379" NODE_ENV: production depends_on: redis: { condition: service_healthy } web: build: context: . dockerfile: docker/Dockerfile.web args: API_URL: http://api:3125 container_name: coursecraft-web restart: unless-stopped env_file: .env environment: API_URL: http://api:3125 PORT: "3080" NODE_ENV: production ports: - "3080:3080" depends_on: - api networks: default: name: coursecraft-network