-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
129 lines (121 loc) · 3.16 KB
/
docker-compose.yml
File metadata and controls
129 lines (121 loc) · 3.16 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
services:
web_server:
image: "docker-angular_todo"
container_name: "angular_frontend"
build:
context: ./todoapp/
dockerfile: ./DOCKERFILE
ports:
- "4200:4000"
volumes:
- "todoapp:/todoapp"
- "node_modules:/todoapp/node_modules"
depends_on:
springboot_api:
condition: service_healthy
networks:
- frontend
springboot_api:
image: 'docker-springboot_todo'
container_name: "springboot_backend"
build:
context: ./api/
dockerfile: ./DOCKERFILE
ports:
- "8080:8080"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgresdatabase:5432/todolist_db
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- SPRING_JPA_HIBERNATE_DDL_AUTO=create-drop
depends_on:
postgresdatabase:
condition: service_healthy
networks:
- frontend
- backend
healthcheck:
test: "curl --fail --silent localhost:8080/actuator/health | grep UP || exit 1"
interval: 15s
timeout: 5s
retries: 5
start_period: 10s
postgresdatabase:
image: postgres:16
container_name: "postgresDB"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=todolist_db
networks:
- backend
volumes:
- './.containers/data:/var/lib/postgresql/data'
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres"]
interval: 1s
timeout: 5s
retries: 5
start_period: 20s
login_server:
image: 'docker-login-server'
container_name: "login-server"
build:
context: ./login/
dockerfile: ./DOCKERFILE
ports:
- "9081:8081"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- SPRING_DATASOURCE_URL=jdbc:postgresql://userdatabase:5432/login_db
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- SPRING_JPA_HIBERNATE_DDL_AUTO=create-drop
networks:
- login
depends_on:
userdatabase:
condition: service_healthy
healthcheck:
test: "curl --fail -k localhost:8081/actuator/health | grep UP || exit 1"
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
userdatabase:
image: postgres:16
container_name: "userdatabase"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=login_db
networks:
- login
volumes:
- './.containers_login/data:/var/lib/postgresql/data'
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres"]
interval: 1s
timeout: 5s
retries: 5
start_period: 20s
networks:
frontend:
name: backend_connection_network
driver: bridge
backend:
name: database_connection_network
driver: bridge
login:
name: user_connection_network
driver: bridge
volumes:
todoapp:
driver: local
node_modules:
driver: local
postgres_data:
driver: local