-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (73 loc) · 1.62 KB
/
docker-compose.yml
File metadata and controls
78 lines (73 loc) · 1.62 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
services:
old-db:
image: postgres:16-alpine
container_name: weather-old-db
environment:
POSTGRES_USER: WeatherTrack
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: WeatherTrack
ports:
- "5432:5432"
volumes:
- old-db-data:/var/lib/postgresql/data
networks:
- weather-old-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U WeatherTrack"]
interval: 5s
timeout: 5s
retries: 5
old-api:
build:
context: ./old-code
dockerfile: Dockerfile
container_name: weather-old-api
ports:
- "3000:3000"
environment:
NODE_ENV: production
depends_on:
old-db:
condition: service_healthy
networks:
- weather-old-network
restart: on-failure
new-db:
image: postgres:16-alpine
container_name: weather-new-db
environment:
POSTGRES_USER: WeatherTrack
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: WeatherTrack
ports:
- "5433:5432"
volumes:
- new-db-data:/var/lib/postgresql/data
networks:
- weather-new-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U WeatherTrack"]
interval: 5s
timeout: 5s
retries: 5
new-api:
build:
context: ./new-code
dockerfile: Dockerfile
container_name: weather-new-api
ports:
- "3001:3000"
environment:
NODE_ENV: production
depends_on:
new-db:
condition: service_healthy
networks:
- weather-new-network
restart: on-failure
volumes:
old-db-data:
new-db-data:
networks:
weather-old-network:
weather-new-network: