Files
balikci/docker-compose.yml
salvacybersec 05bb2fc55c setup script
2025-11-11 04:36:35 +03:00

91 lines
2.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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