diff --git a/docker/compose/docker-compose-local.yml b/docker/compose/docker-compose-local.yml new file mode 100644 index 0000000..5e3c80d --- /dev/null +++ b/docker/compose/docker-compose-local.yml @@ -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:-pgadmin4@pgadmin.org} + 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: diff --git a/docker-compose.yml b/docker/compose/docker-compose.yml similarity index 85% rename from docker-compose.yml rename to docker/compose/docker-compose.yml index 9441004..b953949 100644 --- a/docker-compose.yml +++ b/docker/compose/docker-compose.yml @@ -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 @@ -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 @@ -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' diff --git a/prometheus/prometheus.yml b/docker/config/prometheus/prometheus.yml similarity index 100% rename from prometheus/prometheus.yml rename to docker/config/prometheus/prometheus.yml