Created
March 12, 2020 22:24
-
-
Save thinkmicroservices/32115d195e7bf157ac70558890ed9181 to your computer and use it in GitHub Desktop.
NotificationService: dc-07-notification.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## docker-compose -f ./dc-06-outbound-sms.yml up -d | |
| version: "3.7" | |
| services: | |
| ############################################################## | |
| # INFRASTRUCTURE SERVICES | |
| ################ | |
| # Elastisearch # https://geowarin.com/spring-boot-logs-in-elastic-search-with-fluentd/ | |
| ################ | |
| elasticsearch: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0 | |
| # container_name: elasticsearch | |
| environment: | |
| - "discovery.type=single-node" | |
| expose: | |
| - "9200" | |
| ports: | |
| - "9200:9200" | |
| networks: | |
| - spring_ri_network | |
| ########## | |
| # Kibana # http://localhost:5601/app/kibana#/home | |
| ########## | |
| kibana: | |
| image: kibana:7.2.0 | |
| links: | |
| - "elasticsearch" | |
| ports: | |
| - "5601:5601" | |
| depends_on: | |
| - elasticsearch | |
| networks: | |
| - spring_ri_network | |
| ########### | |
| # fluentd # | |
| ########### | |
| fluentd: | |
| #build: ./fluentd | |
| image: thinkmicroservices/fluentd:latest | |
| #volumes: | |
| # - ./fluentd/conf:/fluentd/etc | |
| links: | |
| - "elasticsearch" | |
| ports: | |
| - "24224:24224" | |
| - "24224:24224/udp" | |
| networks: | |
| - spring_ri_network | |
| depends_on: | |
| - elasticsearch | |
| ############ | |
| # Postgres # | |
| ############ | |
| postgresDB: | |
| image: postgres | |
| restart: always | |
| ports: | |
| - 5432:5432 | |
| environment: | |
| POSTGRES_PASSWORD: docker | |
| networks: | |
| - spring_ri_network | |
| postgresADMIN: | |
| image: dpage/pgadmin4 | |
| ports: | |
| - 1080:80 | |
| environment: | |
| - PGADMIN_DEFAULT_EMAIL=user@domain.com | |
| - PGADMIN_DEFAULT_PASSWORD=password | |
| networks: | |
| - spring_ri_network | |
| ####################### | |
| # RABBIT MQ Messaging # | |
| ####################### | |
| rabbitmq: | |
| image: rabbitmq:3.5.3-management | |
| ports: | |
| - 15672:15672 | |
| - 5672:5672 | |
| environment: | |
| - RABBITMQ_DEFAULT_USER=think | |
| - RABBITMQ_DEFAULT_PASS=microservices | |
| networks: | |
| - spring_ri_network | |
| ############################################################## | |
| # APPLICATION SERVICES | |
| ######################### | |
| # configuration service #http://localhost:8888/actuator/health | |
| ######################### | |
| config-service: | |
| image: thinkmicroservices/configuration-service:latest | |
| environment: | |
| - spring.main.banner-mode="off" | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 8888:8888 | |
| healthcheck: | |
| test: ["CMD", "curl", "--fail", "--silent", "http://think:microservices@localhost:8888/actuator/health"] | |
| interval: 30s | |
| timeout: 30s | |
| retries: 10 | |
| depends_on: | |
| - fluentd | |
| ## - postgresDB | |
| ## - rabbitmq | |
| links: | |
| - fluentd | |
| logging: | |
| driver: "fluentd" | |
| options: | |
| fluentd-address: localhost:24224 | |
| tag: configuration.svc | |
| ##################### | |
| # discovery service # | |
| ##################### | |
| discovery-service: | |
| image: thinkmicroservices/discovery-service:latest | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 8761:8761 | |
| links: | |
| - fluentd | |
| healthcheck: | |
| test: ["CMD", "curl", "--fail", "--silent", "http://think:microservices@localhost:8761/actuator/health"] | |
| interval: 30s | |
| timeout: 30s | |
| retries: 10 | |
| depends_on: | |
| - config-started | |
| restart: on-failure | |
| logging: | |
| driver: "fluentd" | |
| options: | |
| fluentd-address: localhost:24224 | |
| tag: discovery.svc | |
| ################### | |
| # content service # | |
| ################### | |
| content-service: | |
| image: thinkmicroservices/content-service:latest | |
| restart: on-failure:5 | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - app.message="whats up" | |
| - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| - spring.data.mongodb.host=mongo-db-service | |
| - spring.data.mongodb.port=27017 | |
| - spring.data.mongodb.database=content-service | |
| - spring.data.mongodb.repositories.enable=true | |
| ## - server.port=4040 | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 4040:4040 | |
| depends_on: | |
| - config-started | |
| links: | |
| - fluentd | |
| # logging: | |
| # driver: "fluentd" | |
| # options: | |
| # fluentd-address: localhost:24224 | |
| # tag: content.svc | |
| ####################### | |
| # api-gateway service # | |
| ####################### | |
| api-gateway-service: | |
| image: thinkmicroservices/api-gateway-service:latest | |
| restart: on-failure:5 | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| - logging.level.com.thinkmicroservices=TRACE | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 8080:8080 | |
| depends_on: | |
| - config-service | |
| - discovery-service | |
| links: | |
| - fluentd | |
| logging: | |
| driver: "fluentd" | |
| options: | |
| fluentd-address: localhost:24224 | |
| tag: api-gateway.svc | |
| ################## | |
| # config-started # | |
| ################## | |
| # this service allows us to wait for the | |
| # configuration-service to start before | |
| # starting any service with this | |
| # declared as a dependency | |
| # | |
| # https://8thlight.com/blog/dariusz-pasciak/2016/10/17/docker-compose-wait-for-dependencies.html | |
| config-started: | |
| image: dadarek/wait-for-dependencies | |
| depends_on: | |
| - config-service | |
| command: http://think:microservices@localhost:8888/actuator/health 2>&1 | grep UP || exit 1 | |
| ##################### | |
| # discovery-started # | |
| ##################### | |
| # this service allows us to wait for the | |
| # discovery-service to start before | |
| # starting any service with this | |
| # declared as a dependency | |
| discovery-started: | |
| image: dadarek/wait-for-dependencies | |
| depends_on: | |
| - discovery-service | |
| command: http://think:microservices@localhost:8761/actuator/health 2>&1 | grep UP || exit 1 | |
| ######################## | |
| # notification service # | |
| ######################## | |
| notification-service: | |
| image: thinkmicroservices/notification-service:latest | |
| restart: on-failure:5 | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| - SPRING_RABBITMQ_HOST=rabbitmq | |
| - SPRING_RABBITMQ_USERNAME=think | |
| - SPRING_RABBITMQ_PASSWORD=microservices | |
| - logging.level.com.thinkmicroservices=TRACE | |
| - spring.profiles.active=dev, swagger | |
| depends_on: | |
| - config-service | |
| - discovery-service | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 6005:8080 | |
| links: | |
| - fluentd | |
| logging: | |
| driver: "fluentd" | |
| options: | |
| fluentd-address: localhost:24224 | |
| tag: notification.svc | |
| ########################## | |
| # email outbound service # | |
| ########################## | |
| email-outbound-service: | |
| image: thinkmicroservices/outbound-email-service:latest | |
| restart: on-failure:5 | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| - spring.rabbitmq.host=rabbitmq | |
| - spring.rabbitmq.username=think | |
| - spring.rabbitmq.password=microservices | |
| - logging.level.com.thinkmicroservices=TRACE | |
| - spring.profiles.active=dev, swagger | |
| # depends_on: | |
| # - config-service | |
| # - discovery-service | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 6010:8080 | |
| #links: | |
| # - fluentd | |
| #logging: | |
| # driver: "fluentd" | |
| # options: | |
| # fluentd-address: localhost:24224 | |
| # tag: email-outbound.svc | |
| ######################## | |
| # sms outbound service # | |
| ######################## | |
| sms-outbound-service: | |
| image: thinkmicroservices/outbound-sms-service:latest | |
| restart: on-failure:5 | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| - spring.rabbitmq.host=rabbitmq | |
| - spring.rabbitmq.username=think | |
| - spring.rabbitmq.password=microservices | |
| - spring.profiles.active=dev, swagger, twilio | |
| - twilio.authID=44101d4c090f9b189c0f422d43c52c3b | |
| - twilio.accountSID=ACbc5aaad89084f9bea7df5a5f7c7d3f85 | |
| - logging.level.com.thinkmicroservices=INFO | |
| depends_on: | |
| - config-service | |
| - discovery-service | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 6020:8080 | |
| links: | |
| - fluentd | |
| # logging: | |
| # driver: "fluentd" | |
| # options: | |
| # fluentd-address: localhost:24224 | |
| # tag: sms-outbound.svc | |
| ######################## | |
| # notification service # | |
| ######################## | |
| notification-service: | |
| image: thinkmicroservices/notification-service:latest | |
| restart: on-failure:5 | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| - spring.rabbitmq.host=rabbitmq | |
| - spring.rabbitmq.username=think | |
| - spring.rabbitmq.password=microservices | |
| - logging.level.com.thinkmicroservices=TRACE | |
| - spring.profiles.active=dev, swagger | |
| depends_on: | |
| - config-service | |
| - discovery-service | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 6005:8080 | |
| links: | |
| - fluentd | |
| logging: | |
| driver: "fluentd" | |
| options: | |
| fluentd-address: localhost:24224 | |
| tag: notification.svc | |
| ################## | |
| # define network # | |
| ################## | |
| networks: | |
| spring_ri_network: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment