Last active
March 11, 2020 01:19
-
-
Save thinkmicroservices/22dd0758945958d48a42abe4dd174472 to your computer and use it in GitHub Desktop.
OutboundEmailService: dc-05-outbound-email.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-05-outbound-email.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 | |
| ####################### | |
| # 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 | |
| ########################## | |
| # outbound email service # | |
| ########################## | |
| outbound-email-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 | |
| - 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 | |
| ################## | |
| # 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 | |
| ################## | |
| # define network # | |
| ################## | |
| networks: | |
| spring_ri_network: | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment