-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (75 loc) · 1.56 KB
/
Copy pathdocker-compose.yml
File metadata and controls
81 lines (75 loc) · 1.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
version: '3.8'
services:
# MongoDB Database
mongodb:
image: mongo:6
container_name: gdocs-mongodb
restart: unless-stopped
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
environment:
MONGO_INITDB_DATABASE: google-docs-clone
networks:
- gdocs-network
# Redis Cache
redis:
image: redis:7-alpine
container_name: gdocs-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
networks:
- gdocs-network
# Backend Server
server:
build:
context: .
dockerfile: Dockerfile.server
container_name: gdocs-server
restart: unless-stopped
ports:
- "5000:5000"
environment:
- NODE_ENV=production
- PORT=5000
- MONGODB_URI=mongodb://mongodb:27017/google-docs-clone
- REDIS_HOST=redis
- REDIS_PORT=6379
- JWT_SECRET=${JWT_SECRET}
- ACCESS_TOKEN_EXPIRY=15m
- REFRESH_TOKEN_EXPIRY=7d
- CLIENT_ORIGIN=http://localhost:3000
- LOG_LEVEL=info
depends_on:
- mongodb
- redis
networks:
- gdocs-network
volumes:
- ./server/logs:/app/logs
# Frontend Client
client:
build:
context: .
dockerfile: Dockerfile.client
container_name: gdocs-client
restart: unless-stopped
ports:
- "3000:80"
depends_on:
- server
networks:
- gdocs-network
volumes:
mongodb_data:
driver: local
redis_data:
driver: local
networks:
gdocs-network:
driver: bridge