Skip to content

Commit 946ed8e

Browse files
author
Adnane Miliari
committed
🏗️ reorganize docker configuration with clean architecture
1 parent 1127bed commit 946ed8e

File tree

3 files changed

+88
-4
lines changed

3 files changed

+88
-4
lines changed
+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
services:
2+
postgres:
3+
container_name: postgres-local
4+
image: postgres:15.5-alpine
5+
environment:
6+
POSTGRES_USER: postgres
7+
POSTGRES_PASSWORD: password
8+
PGDATA: /data/postgres
9+
volumes:
10+
- postgres-local:/data/postgres
11+
ports:
12+
- "5432:5432"
13+
networks:
14+
- postgres-local
15+
restart: unless-stopped
16+
17+
pgadmin:
18+
container_name: pgadmin-local
19+
image: dpage/pgadmin4
20+
environment:
21+
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
22+
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
23+
PGADMIN_CONFIG_SERVER_MODE: 'False'
24+
volumes:
25+
- pgadmin-local:/var/lib/pgadmin
26+
ports:
27+
- "5050:80"
28+
networks:
29+
- postgres-local
30+
restart: unless-stopped
31+
32+
zipkin:
33+
image: openzipkin/zipkin:latest
34+
container_name: zipkin-local
35+
ports:
36+
- "9411:9411"
37+
networks:
38+
- spring-local
39+
40+
rabbitmq:
41+
image: rabbitmq:3.12-management-alpine
42+
container_name: rabbitmq-local
43+
ports:
44+
- "5672:5672"
45+
- "15672:15672"
46+
networks:
47+
- spring-local
48+
49+
networks:
50+
postgres-local:
51+
driver: bridge
52+
spring-local:
53+
driver: bridge
54+
55+
volumes:
56+
postgres-local:
57+
pgadmin-local:

docker-compose.yml renamed to docker/compose/docker-compose.yml

+31-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
postgres:
33
container_name: postgres
4-
image: postgres:14.5-alpine
4+
image: postgres:15.5-alpine
55
environment:
66
POSTGRES_USER: miliariadnane
77
POSTGRES_PASSWORD: password
@@ -12,7 +12,16 @@ services:
1212
- "5432:5432"
1313
networks:
1414
- postgres
15+
healthcheck:
16+
test: [ "CMD-SHELL", "pg_isready -U miliariadnane" ]
17+
interval: 10s
18+
timeout: 5s
19+
retries: 5
1520
restart: unless-stopped
21+
deploy:
22+
resources:
23+
limits:
24+
memory: 1G
1625
pgadmin:
1726
container_name: pgadmin
1827
image: dpage/pgadmin4
@@ -28,28 +37,46 @@ services:
2837
- postgres
2938
restart: unless-stopped
3039
zipkin:
31-
image: openzipkin/zipkin
40+
image: openzipkin/zipkin:latest
3241
container_name: zipkin
3342
ports:
3443
- "9411:9411"
3544
networks:
3645
- spring
3746
- monitoring
47+
healthcheck:
48+
test: [ "CMD", "wget", "-q", "--tries=1", "--spider", "http://localhost:9411/health" ]
49+
interval: 30s
50+
timeout: 10s
51+
retries: 3
52+
deploy:
53+
resources:
54+
limits:
55+
memory: 512M
3856
rabbitmq:
39-
image: rabbitmq:3.9.20-management-alpine
57+
image: rabbitmq:3.12-management-alpine
4058
container_name: rabbitmq
4159
ports:
4260
- "5672:5672" # default port for RabbitMQ
4361
- "15672:15672" # management port
4462
networks:
4563
- spring
64+
healthcheck:
65+
test: [ "CMD", "rabbitmq-diagnostics", "check_port_connectivity" ]
66+
interval: 30s
67+
timeout: 10s
68+
retries: 3
69+
deploy:
70+
resources:
71+
limits:
72+
memory: 512M
4673
prometheus:
4774
image: prom/prometheus:latest
4875
container_name: prometheus
4976
ports:
5077
- "9090:9090"
5178
volumes:
52-
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
79+
- ../config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
5380
- prometheus_data:/prometheus
5481
command:
5582
- '--config.file=/etc/prometheus/prometheus.yml'
File renamed without changes.

0 commit comments

Comments
 (0)