-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (68 loc) · 1.46 KB
/
docker-compose.yml
File metadata and controls
72 lines (68 loc) · 1.46 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
services:
experience:
build: ./server/api/linkedin/
container_name: experience-service
restart: unless-stopped
ports:
- "3002:8000"
env_file:
- ./server/api/linkedin/.env
depends_on:
- db
cdn:
image: nginx:alpine
container_name: portfolio-cdn
restart: unless-stopped
ports:
- "3001:80"
volumes:
- cdn_data:/usr/share/nginx/html
- cdn_config:/etc/nginx:ro
depends_on:
- cdn_init
healthcheck:
test:
[
"CMD",
"wget",
"--quiet",
"--tries=1",
"--spider",
"http://localhost/health",
]
interval: 30s
timeout: 10s
retries: 3
cdn_init:
image: nginx:alpine
container_name: cdn-config-init
volumes:
- cdn_config:/tmp/nginx
- ./server/cdn/nginx.conf:/tmp/nginx.conf:ro
command: >
sh -c "
cp /tmp/nginx.conf /tmp/nginx/nginx.conf &&
echo 'CDN configuration copied successfully'
"
restart: "no"
db:
image: postgres:16
container_name: database
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: appdb
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d appdb"]
interval: 5s
timeout: 3s
retries: 10
volumes:
pgdata:
cdn_data:
cdn_config: