Skip to content

Instantly share code, notes, and snippets.

@thinkmicroservices
Created February 25, 2020 19:18
Show Gist options
  • Select an option

  • Save thinkmicroservices/22f64a9314e80d958cbae97639adf92b to your computer and use it in GitHub Desktop.

Select an option

Save thinkmicroservices/22f64a9314e80d958cbae97639adf92b to your computer and use it in GitHub Desktop.
content-service:docker-compose dc-03-content.yml
## docker-compose -f ./dc-03-content.yml up -d
version: "3.7"
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
#########################
# 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
##################
# config-started #
##################
# this service allows us to wait for the
# configuration-service to start before
# starting any service with this
# declared as a dependency
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
networks:
spring_ri_network:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment