-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
136 lines (124 loc) · 3.24 KB
/
docker-compose.dev.yml
File metadata and controls
136 lines (124 loc) · 3.24 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
services:
postgres:
image: postgres:15-alpine
container_name: cmp-postgres
environment:
POSTGRES_DB: cmp
POSTGRES_USER: cmp_user
POSTGRES_PASSWORD: cmp_password
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
ports:
- "5432:5432"
volumes:
- postgres_dev_data:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
networks:
- cmp-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cmp_user -d cmp"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: cmp-redis
ports:
- "6379:6379"
volumes:
- redia_dev_data:/data
networks:
- cmp-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
nats:
image: nats:2.10-alpine
container_name: cmp-nats
command: ["--port", "4222", "--http_port", "8222", "--jetstream"]
ports:
- "4222:4222"
- "8222:8222"
networks:
- cmp-network
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8222/healthz || exit 1"]
interval: 10s
timeout: 5s
retries: 5
cmp-server:
build:
context: .
dockerfile: Dockerfile
container_name: cmp-server
environment:
# Application Environment
- CMP_ENV=development
# Server Configuration
- CMP_PORT=8080
- CMP_HOST=0.0.0.0
# Database Configuration
- CMP_DB_HOST=postgres
- CMP_DB_PORT=5432
- CMP_DB_NAME=cmp
- CMP_DB_USER=cmp_user
- CMP_DB_PASSWORD=cmp_password
- CMP_DB_SSLMODE=disable
- CMP_DB_MAX_CONNS=25
- CMP_DB_MIN_CONNS=5
# Redis Configuration
- CMP_REDIS_HOST=redis
- CMP_REDIS_PORT=6379
- CMP_REDIS_PASSWORD=
- CMP_REDIS_DB=0
- CMP_REDIS_POOL_SIZE=10
# JWT Configuration
- CMP_JWT_SECRET=A3/TRVASQZkXqqt27ZnT7m/UboTfizF26/CaUSlZHLOlfQ2h8Gd1xzdIeuQnSeQX
- CMP_JWT_EXPIRATION=24
- CMP_JWT_ISSUER=cmp
# Encryption Configuration
- CMP_ENCRYPTION_KEY=99ek1nyT4IJ4W2tUvks9TvHqIdNn7rKZd2kcgQ9gSuf2xoKAaW3BnDl73iMpTwsc
# NATS Configuration
- CMP_NATS_URL=nats://nats:4222
- CMP_NATS_CLUSTER=cmp-cluster
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
nats:
condition: service_healthy
networks:
- cmp-network
volumes:
- ./configs:/app/configs:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
cmp-frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: cmp-frontend
environment:
- NODE_ENV=development
- NEXT_PUBLIC_API_URL=http://localhost:8080
ports:
- "3000:3000"
depends_on:
- cmp-server
networks:
- cmp-network
restart: unless-stopped
volumes:
postgres_dev_data:
redia_dev_data:
networks:
cmp-network:
driver: bridge