/
I.T_Egor
/
java-plus-graduation
Обзор
Документация
Войти
/
I.T_Egor
/
java-plus-graduation
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docker-compose.yml
340 строк
9 KB
IT-Egor
add docker support
13 авг 2025, 01:25
13 авг 2025, 01:25
f7bef50
Код
Авторство
О чём код?
services: discovery-server: image: discovery-server container_name: discovery-server build: context: . dockerfile: infra/discovery-server/Dockerfile ports: - "8761:8761" healthcheck: test: wget --no-verbose --tries=1 --spider http://localhost:8761/actuator/health || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 config-server: image: config-server container_name: config-server build: context: . dockerfile: infra/config-server/Dockerfile healthcheck: test: wget --no-verbose --tries=1 --spider http://discovery-server:8761/eureka/apps/CONFIG-SERVER || exit 1 interval: 30s timeout: 5s start_period: 60s retries: 5 depends_on: discovery-server: condition: service_healthy gateway-server: image: gateway-server container_name: gateway-server build: context: . dockerfile: infra/gateway-server/Dockerfile ports: - "8080:8080" environment: - SPRING_PROFILES_ACTIVE=docker healthcheck: test: wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 depends_on: discovery-server: condition: service_healthy config-server: condition: service_healthy user-service: image: user-service container_name: user-service build: context: . dockerfile: core/user-service/Dockerfile environment: - SPRING_PROFILES_ACTIVE=docker healthcheck: test: wget --no-verbose --tries=1 --spider http://discovery-server:8761/eureka/apps/USER-SERVICE || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 depends_on: discovery-server: condition: service_healthy config-server: condition: service_healthy gateway-server: condition: service_healthy user-db: condition: service_healthy event-service: image: event-service container_name: event-service build: context: . dockerfile: core/event-service/Dockerfile environment: - SPRING_PROFILES_ACTIVE=docker healthcheck: test: wget --no-verbose --tries=1 --spider http://discovery-server:8761/eureka/apps/EVENT-SERVICE || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 depends_on: discovery-server: condition: service_healthy config-server: condition: service_healthy gateway-server: condition: service_healthy event-db: condition: service_healthy request-service: image: request-service container_name: request-service build: context: . dockerfile: core/request-service/Dockerfile environment: - SPRING_PROFILES_ACTIVE=docker healthcheck: test: wget --no-verbose --tries=1 --spider http://discovery-server:8761/eureka/apps/REQUEST-SERVICE || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 depends_on: discovery-server: condition: service_healthy config-server: condition: service_healthy gateway-server: condition: service_healthy request-db: condition: service_healthy comment-service: image: comment-service container_name: comment-service build: context: . dockerfile: core/comment-service/Dockerfile environment: - SPRING_PROFILES_ACTIVE=docker healthcheck: test: wget --no-verbose --tries=1 --spider http://discovery-server:8761/eureka/apps/COMMENT-SERVICE || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 depends_on: discovery-server: condition: service_healthy config-server: condition: service_healthy gateway-server: condition: service_healthy comment-db: condition: service_healthy collector: image: collector:latest container_name: collector build: context: . dockerfile: stats-service/collector/Dockerfile environment: - SPRING_PROFILES_ACTIVE=docker healthcheck: test: wget --no-verbose --tries=1 --spider http://discovery-server:8761/eureka/apps/COLLECTOR || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 depends_on: discovery-server: condition: service_healthy config-server: condition: service_healthy kafka: condition: service_healthy aggregator: image: aggregator:latest container_name: aggregator build: context: . dockerfile: stats-service/aggregator/Dockerfile environment: - SPRING_PROFILES_ACTIVE=docker healthcheck: test: wget --no-verbose --tries=1 --spider http://discovery-server:8761/eureka/apps/AGGREGATOR || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 depends_on: discovery-server: condition: service_healthy config-server: condition: service_healthy kafka: condition: service_healthy analyzer: image: analyzer:latest container_name: analyzer build: context: . dockerfile: stats-service/analyzer/Dockerfile environment: - SPRING_PROFILES_ACTIVE=docker healthcheck: test: wget --no-verbose --tries=1 --spider http://discovery-server:8761/eureka/apps/ANALYZER || exit 1 interval: 30s timeout: 5s start_period: 30s retries: 5 depends_on: discovery-server: condition: service_healthy config-server: condition: service_healthy kafka: condition: service_healthy analyzer-db: condition: service_healthy event-db: image: postgres:16.1 container_name: event-db ports: - "6542:5432" environment: - POSTGRES_DB=event-db - POSTGRES_USER=edb - POSTGRES_PASSWORD=password volumes: - ./volumes/postgres/event_data:/var/lib/postgresql/data/ healthcheck: test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER timeout: 5s interval: 5s retries: 10 user-db: image: postgres:16.1 container_name: user-db ports: - "6544:5432" environment: - POSTGRES_DB=user-db - POSTGRES_USER=udb - POSTGRES_PASSWORD=password volumes: - ./volumes/postgres/user_data:/var/lib/postgresql/data/ healthcheck: test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER timeout: 5s interval: 5s retries: 10 request-db: image: postgres:16.1 container_name: request-db ports: - "6545:5432" environment: - POSTGRES_DB=request-db - POSTGRES_USER=rdb - POSTGRES_PASSWORD=password volumes: - ./volumes/postgres/request_data:/var/lib/postgresql/data/ healthcheck: test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER timeout: 5s interval: 5s retries: 10 comment-db: image: postgres:16.1 container_name: comment-db ports: - "6546:5432" environment: - POSTGRES_DB=comment-db - POSTGRES_USER=cdb - POSTGRES_PASSWORD=password volumes: - ./volumes/postgres/comment_data:/var/lib/postgresql/data/ healthcheck: test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER timeout: 5s interval: 5s retries: 10 analyzer-db: image: postgres:16.1 container_name: analyzer-db ports: - "6547:5432" environment: - POSTGRES_DB=analyzer-db - POSTGRES_USER=adb - POSTGRES_PASSWORD=password volumes: - ./volumes/postgres/analyzer-data:/var/lib/postgresql/data/ healthcheck: test: pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER timeout: 5s interval: 5s retries: 10 kafka: image: confluentinc/confluent-local:7.4.3 hostname: kafka container_name: kafka ports: - "9092:9092" # for client connections - "9101:9101" # JMX - "29092:29092" # internal restart: unless-stopped environment: KAFKA_NODE_ID: 1 KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092' KAFKA_JMX_PORT: 9101 KAFKA_JMX_HOSTNAME: localhost KAFKA_PROCESS_ROLES: 'broker,controller' KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka:29093' KAFKA_LISTENERS: 'PLAINTEXT://kafka:29092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:9092' CLUSTER_ID: 'K0EA9p0yEe6MkAAAAkKsEg' healthcheck: test: [ "CMD-SHELL", "kafka-broker-api-versions --bootstrap-server kafka:29092" ] interval: 5s timeout: 10s retries: 10 kafka-init-topics: image: confluentinc/confluent-local:7.4.3 container_name: kafka-init-topics depends_on: - kafka command: "bash -c \ 'kafka-topics --create --topic stats.user-actions.v1 \ --partitions 1 --replication-factor 1 --if-not-exists \ --bootstrap-server kafka:29092 && \ kafka-topics --create --topic stats.events-similarity.v1 \ --partitions 1 --replication-factor 1 --if-not-exists \ --bootstrap-server kafka:29092'" init: true