Created
March 31, 2020 04:30
-
-
Save thinkmicroservices/831d6941d7de0713a70e84fb512356c8 to your computer and use it in GitHub Desktop.
AccountProfileService:Docker-Compose dc-09-account-history.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-09-account-history.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: | |
| - [email protected] | |
| - PGADMIN_DEFAULT_PASSWORD=password | |
| networks: | |
| - spring_ri_network | |
| ############ | |
| # mongo db # | |
| ############ | |
| mongo-db-service: | |
| image: mongo:latest | |
| ports: | |
| - 27017:27017 | |
| networks: | |
| - spring_ri_network | |
| mongo-express: | |
| image: mongo-express:latest | |
| ports: | |
| - 8081:8081 | |
| environment: | |
| - ME_CONFIG_MONGODB_SERVER=mongo-db-service | |
| networks: | |
| - spring_ri_network | |
| depends_on: | |
| - mongo-db-service | |
| ####################### | |
| # RABBIT MQ Messaging # | |
| ####################### | |
| rabbitmq: | |
| image: rabbitmq:3.5.3-management | |
| ports: | |
| - 15672:15672 | |
| - 5672:5672 | |
| 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 | |
| ########################## | |
| # authentication service # | |
| ########################## | |
| auth-service: | |
| image: thinkmicroservices/authentication-service:latest | |
| restart: on-failure:5 | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - spring.datasource.url=jdbc:postgresql://postgresDB:5432/postgres | |
| - authentication.usernameRegex=^[A-Z]{6,20}$$ #need to escape $ with another $ | |
| - authentication.authenticationMode=USERNAME | |
| - active.services.required.for.authentication=API-GATEWAY-SERVICE | |
| - jwt.issuer=ThinkMicroservices.com | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| - token.expiration.interval.minutes=10 | |
| - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka | |
| - SPRING_RABBITMQ_HOST=rabbitmq | |
| - spring.profiles.active=dev ,swagger | |
| - logging.level.com.thinkmicroservices=TRACE | |
| ## - spring.datasource.username: postgresDB | |
| ## - spring.datasource.password: docker | |
| ## - spring.datasource.platform: postgres | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 7777:8080 | |
| depends_on: | |
| - postgresDB | |
| - rabbitmq | |
| - config-started | |
| - api-gateway-service | |
| - account-profile-started | |
| #- account-profile-service | |
| links: | |
| - fluentd | |
| #logging: | |
| # driver: "fluentd" | |
| # options: | |
| # fluentd-address: localhost:24224 | |
| # tag: authentication.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 | |
| - 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/email-outbound-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 | |
| ########################### | |
| # account profile service # | |
| ########################### | |
| account-profile-service: | |
| image: thinkmicroservices/account-profile-service:latest | |
| restart: on-failure:5 | |
| environment: | |
| - spring.main.banner-mode="off" | |
| - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka | |
| - SPRING_RABBITMQ_HOST=rabbitmq | |
| - spring.cloud.config.uri=http://config-service:8888 | |
| - spring.data.mongodb.host=mongo-db-service | |
| - spring.data.mongodb.port=27017 | |
| - spring.data.mongodb.database=account-profile | |
| - spring.data.mongodb.repositories.enable=true | |
| - spring.profiles.active=dev, swagger | |
| - logging.level.com.thinkmicroservices=TRACE | |
| depends_on: | |
| - config-service | |
| - discovery-service | |
| networks: | |
| - spring_ri_network | |
| ports: | |
| - 5020:8080 | |
| links: | |
| - fluentd | |
| # logging: | |
| # driver: "fluentd" | |
| # options: | |
| # fluentd-address: localhost:24224 | |
| # tag: authentication.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 | |
| ########################### | |
| # account-profile-started # | |
| ########################### | |
| # this service allows us to wait for the | |
| # account-profile-service to start before | |
| # starting any service with this | |
| # declared as a dependency | |
| account-profile-started: | |
| image: dadarek/wait-for-dependencies | |
| depends_on: | |
| - discovery-service | |
| command: http://think:microservices@localhost:5020/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