-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dev.yaml
138 lines (131 loc) · 2.97 KB
/
docker-compose.dev.yaml
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
137
138
version: '3.8'
services:
db:
image: postgres:16
container_name: login-api-db
volumes:
- db-data:/var/lib/postgresql/data
env_file:
- .env
healthcheck:
test:
['CMD-SHELL', 'pg_isready', '-U', '${PGUSER}', '-d', '${POSTGRES_DB}']
interval: 5s
timeout: 3s
retries: 3
start_period: 5s
networks:
app-network:
ipv4_address: 10.1.0.20
api:
build:
context: .
target: DEV
container_name: login-api
restart: always
env_file:
- .env
healthcheck:
test:
[
'CMD-SHELL',
'curl -f http://api:${APPLICATION_PORT}/health/check || exit 1',
]
interval: 5s
timeout: 3s
retries: 3
start_period: 5s
volumes:
- ./:/home/node/login-api
networks:
app-network:
ipv4_address: 10.1.0.21
depends_on:
db:
condition: 'service_healthy'
restart: true
pg-admin:
image: dpage/pgadmin4
restart: always
container_name: login-api-pg-admin
env_file:
- .env
healthcheck:
test:
[
'CMD-SHELL',
'wget --spider -O - http://pg-admin:${PGADMIN_LISTEN_PORT}/misc/ping',
]
interval: 10s
timeout: 5s
retries: 3
start_period: 20s
networks:
app-network:
ipv4_address: 10.1.0.22
depends_on:
db:
condition: 'service_healthy'
restart: true
volumes:
- ./infra/pgadmin/servers.json:/pgadmin4/servers.json
proxy:
image: nginx
container_name: login-api-proxy
volumes:
- ./infra/nginx/nginx.conf.template:/etc/nginx/templates/default.conf.template
ports:
- '10.1.0.1:80:${NGINX_APP_PORT}'
- '10.1.0.1:8080:${NGINX_ADMIN_PORT}'
- '10.1.0.1:9000:${NGINX_PORTAINER_PORT}'
env_file:
- .env
networks:
app-network:
ipv4_address: 10.1.0.23
healthcheck:
test: ['CMD-SHELL', 'service nginx status']
interval: 5s
timeout: 3s
retries: 5
start_period: 15s
depends_on:
db:
condition: 'service_healthy'
restart: true
api:
condition: 'service_healthy'
restart: true
pg-admin:
condition: 'service_healthy'
restart: true
portainer:
condition: 'service_healthy'
restart: true
portainer:
image: portainer/portainer-ce:alpine
restart: always
container_name: login-api-portainer
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- portainer-data:/data
healthcheck:
test: 'wget --no-verbose --tries=1 --spider http://localhost:9000 || exit 1'
interval: 60s
timeout: 5s
retries: 3
start_period: 20s
networks:
app-network:
ipv4_address: 10.1.0.24
networks:
app-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.1.0.0/24
gateway: 10.1.0.1
volumes:
db-data:
portainer-data: