version: '3.8' services: # Backend Service backend: build: context: ./backend dockerfile: Dockerfile container_name: oltalama-backend restart: unless-stopped ports: - "3000:3000" environment: - NODE_ENV=production - PORT=3000 - SESSION_SECRET=${SESSION_SECRET:-} # Boşsa otomatik oluşturulur - AUTO_SEED=${AUTO_SEED:-false} # true yaparsanız örnek data eklenir - GMAIL_USER=${GMAIL_USER} - GMAIL_APP_PASSWORD=${GMAIL_APP_PASSWORD} - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN} - TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID} - DOMAIN_URL=${DOMAIN_URL:-http://localhost:3000} - FRONTEND_URL=${FRONTEND_URL:-http://localhost:4173} - OLLAMA_SERVER_URL=${OLLAMA_SERVER_URL:-http://host.docker.internal:11434} - OLLAMA_MODEL=${OLLAMA_MODEL:-llama3.2:latest} volumes: - backend-data:/app/database - backend-logs:/app/logs networks: - oltalama-network healthcheck: test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"] interval: 30s timeout: 10s retries: 3 start_period: 40s # Frontend Service frontend: build: context: ./frontend dockerfile: Dockerfile container_name: oltalama-frontend restart: unless-stopped ports: - "4173:4173" environment: - NODE_ENV=production - VITE_API_URL=${VITE_API_URL:-http://localhost:3000} depends_on: backend: condition: service_healthy networks: - oltalama-network healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:4173"] interval: 30s timeout: 10s retries: 3 start_period: 40s # Nginx Reverse Proxy (Optional) nginx: image: nginx:alpine container_name: oltalama-nginx restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/ssl:/etc/nginx/ssl:ro depends_on: - backend - frontend networks: - oltalama-network profiles: - with-nginx volumes: backend-data: driver: local backend-logs: driver: local networks: oltalama-network: driver: bridge