Skip to content

Commit

Permalink
🏗️ reorganize docker configuration with clean architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
Adnane Miliari committed Nov 28, 2024
1 parent 1127bed commit 946ed8e
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 4 deletions.
57 changes: 57 additions & 0 deletions docker/compose/docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
services:
postgres:
container_name: postgres-local
image: postgres:15.5-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
PGDATA: /data/postgres
volumes:
- postgres-local:/data/postgres
ports:
- "5432:5432"
networks:
- postgres-local
restart: unless-stopped

pgadmin:
container_name: pgadmin-local
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- pgadmin-local:/var/lib/pgadmin
ports:
- "5050:80"
networks:
- postgres-local
restart: unless-stopped

zipkin:
image: openzipkin/zipkin:latest
container_name: zipkin-local
ports:
- "9411:9411"
networks:
- spring-local

rabbitmq:
image: rabbitmq:3.12-management-alpine
container_name: rabbitmq-local
ports:
- "5672:5672"
- "15672:15672"
networks:
- spring-local

networks:
postgres-local:
driver: bridge
spring-local:
driver: bridge

volumes:
postgres-local:
pgadmin-local:
35 changes: 31 additions & 4 deletions docker-compose.yml → docker/compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
postgres:
container_name: postgres
image: postgres:14.5-alpine
image: postgres:15.5-alpine
environment:
POSTGRES_USER: miliariadnane
POSTGRES_PASSWORD: password
Expand All @@ -12,7 +12,16 @@ services:
- "5432:5432"
networks:
- postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U miliariadnane" ]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
deploy:
resources:
limits:
memory: 1G
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
Expand All @@ -28,28 +37,46 @@ services:
- postgres
restart: unless-stopped
zipkin:
image: openzipkin/zipkin
image: openzipkin/zipkin:latest
container_name: zipkin
ports:
- "9411:9411"
networks:
- spring
- monitoring
healthcheck:
test: [ "CMD", "wget", "-q", "--tries=1", "--spider", "http://localhost:9411/health" ]
interval: 30s
timeout: 10s
retries: 3
deploy:
resources:
limits:
memory: 512M
rabbitmq:
image: rabbitmq:3.9.20-management-alpine
image: rabbitmq:3.12-management-alpine
container_name: rabbitmq
ports:
- "5672:5672" # default port for RabbitMQ
- "15672:15672" # management port
networks:
- spring
healthcheck:
test: [ "CMD", "rabbitmq-diagnostics", "check_port_connectivity" ]
interval: 30s
timeout: 10s
retries: 3
deploy:
resources:
limits:
memory: 512M
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ../config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
Expand Down
File renamed without changes.

0 comments on commit 946ed8e

Please sign in to comment.