-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (102 loc) · 2.56 KB
/
docker-compose.yml
File metadata and controls
109 lines (102 loc) · 2.56 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
version: '3.8'
services:
# Backend API
backend:
build:
context: .
dockerfile: Dockerfile
container_name: smart-hiring-backend
ports:
- "5000:5000"
environment:
- FLASK_ENV=production
- MONGODB_URI=mongodb://mongodb:27017/smart_hiring
- REDIS_URL=redis://redis:6379/0
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- SECRET_KEY=${SECRET_KEY}
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
- SENDGRID_FROM_EMAIL=${SENDGRID_FROM_EMAIL}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
depends_on:
- mongodb
- redis
volumes:
- ./backend/uploads:/app/backend/uploads
- ./backend/logs:/app/backend/logs
networks:
- smart-hiring-network
restart: unless-stopped
# MongoDB Database
mongodb:
image: mongo:7.0
container_name: smart-hiring-mongodb
ports:
- "27017:27017"
environment:
- MONGO_INITDB_DATABASE=smart_hiring
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
networks:
- smart-hiring-network
restart: unless-stopped
# Redis Cache & Queue
redis:
image: redis:7-alpine
container_name: smart-hiring-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- smart-hiring-network
restart: unless-stopped
command: redis-server --appendonly yes
# Background Worker
worker:
build:
context: .
dockerfile: Dockerfile
container_name: smart-hiring-worker
command: python -m backend.workers.job_processor
environment:
- FLASK_ENV=production
- MONGODB_URI=mongodb://mongodb:27017/smart_hiring
- REDIS_URL=redis://redis:6379/0
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- SECRET_KEY=${SECRET_KEY}
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
- SENDGRID_FROM_EMAIL=${SENDGRID_FROM_EMAIL}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- ENABLE_BACKGROUND_WORKERS=true
depends_on:
- mongodb
- redis
networks:
- smart-hiring-network
restart: unless-stopped
# Nginx (optional - for production)
# nginx:
# image: nginx:alpine
# container_name: smart-hiring-nginx
# ports:
# - "80:80"
# - "443:443"
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# - ./frontend:/usr/share/nginx/html:ro
# depends_on:
# - backend
# networks:
# - smart-hiring-network
# restart: unless-stopped
volumes:
mongodb_data:
driver: local
mongodb_config:
driver: local
redis_data:
driver: local
networks:
smart-hiring-network:
driver: bridge