Skip to content

Instantly share code, notes, and snippets.

@thinkmicroservices
thinkmicroservices / Discovery-Service application.yml
Created February 25, 2020 00:59
discovery-service:application.yml
server:
port: ${PORT:8761} # Indicate the default PORT where this service will be started
eureka:
client:
registerWithEureka: false #telling the server not to register himself in the service registry
fetchRegistry: false
server:
waitTimeInMsWhenSyncEmpty: 0 #wait time for subsequent sync
@thinkmicroservices
thinkmicroservices / Discovery-Service Dockerfile
Created February 25, 2020 01:08
discovery-service: Dockerfile
# grab the base image
FROM openjdk:8-jdk-alpine
# install curl
RUN apk add --update \
curl \
&& rm -rf /var/cache/apk/*
# create a working volume in tmp
## docker-compose -f ./dc-01-discovery.yml up -d
version: "3.7"
services:
################
# Elastisearch # https://geowarin.com/spring-boot-logs-in-elastic-search-with-fluentd/
################
@thinkmicroservices
thinkmicroservices / ContentService pom.xml
Created February 25, 2020 17:38
content-service: pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
package com.thinkmicroservices.ri.spring.web;
import javax.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@EnableDiscoveryClient
package com.thinkmicroservices.ri.spring.web;
import javax.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@EnableDiscoveryClient
@thinkmicroservices
thinkmicroservices / content-service: config bootstrap
Last active February 25, 2020 18:00
content-service:bootstrap.yml
spring:
application:
name: CONTENT-SERVICE
cloud:
config:
fail-fast: true
retry:
max-attempts: 10
initial-interval: 1500
@thinkmicroservices
thinkmicroservices / Content Service application.yml
Last active February 25, 2020 18:46
content-service: application.yml
server:
port: 4040
error:
whitelabel:
enabled: false
eureka:
client:
serviceURL:
@thinkmicroservices
thinkmicroservices / content-service: Dockerfile
Created February 25, 2020 18:57
content-service: Dockerfile
# grab the base image
FROM openjdk:8-jdk-alpine
# install curl
RUN apk add --update \
curl \
&& rm -rf /var/cache/apk/*
# create a working volume in tmp
VOLUME /tmp
@thinkmicroservices
thinkmicroservices / content-service: dc-03-content.yml
Created February 25, 2020 19:18
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/
################