-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
112 lines (105 loc) · 2.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
112 lines (105 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# LegalOS 4.0 - Docker Compose Configuration
# Production-ready deployment for NyayaSahayak Platform
version: '3.8'
services:
# Backend API Service
backend:
build:
context: ./backend
dockerfile: ../Dockerfile.backend
container_name: legalos-backend
restart: unless-stopped
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/legalos
- REDIS_URL=redis://redis:6379
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-your-secret-key-change-in-production}
- ENVIRONMENT=${ENVIRONMENT:-production}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:3000,http://localhost:80}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- MAX_WORKERS=4
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- backend_logs:/app/logs
- backend_uploads:/app/uploads
networks:
- legalos-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Frontend Web Application
frontend:
build:
context: ./nyayasahayak-main-main
dockerfile: ../Dockerfile.frontend
container_name: legalos-frontend
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- VITE_API_URL=http://backend:8000
- NODE_ENV=production
depends_on:
- backend
volumes:
- frontend_cache:/var/cache/nginx
- ./ssl:/etc/nginx/ssl:ro
networks:
- legalos-network
# PostgreSQL Database
db:
image: postgres:15-alpine
container_name: legalos-db
restart: unless-stopped
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${DB_PASSWORD:-postgres}
- POSTGRES_DB=legalos
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db:/docker-entrypoint-initdb.d:ro
ports:
- "5432:5432"
networks:
- legalos-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# Redis Cache
redis:
image: redis:7-alpine
container_name: legalos-redis
restart: unless-stopped
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
ports:
- "6379:6379"
networks:
- legalos-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
volumes:
postgres_data:
redis_data:
backend_logs:
backend_uploads:
frontend_cache:
networks:
legalos-network:
driver: bridge