Skip to content

Commit

Permalink
Dockerization.
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetpekdemir committed Sep 1, 2020
1 parent f02de6a commit 0b61792
Show file tree
Hide file tree
Showing 27 changed files with 638 additions and 59 deletions.
39 changes: 39 additions & 0 deletions account-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,49 @@

<build>
<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.26.0</version>
<extensions>true</extensions>
<configuration>
<verbose>true</verbose>
<images>
<image>
<name>${project.artifactId}:${project.version}</name>
<build>
<from>adoptopenjdk/openjdk11</from>
<entryPoint>
<exec>
<args>java</args>
<args>-jar</args>
<args>/maven/${project.artifactId}-${project.version}.jar</args>
</exec>
</entryPoint>
<assembly>
<descriptorRef>artifact</descriptorRef>
</assembly>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build</id>
<phase>post-integration-test</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
4 changes: 3 additions & 1 deletion account-service/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
spring:

application:
name: account-service

cloud:
config:
profile: native
uri: http://localhost:8888
uri: ${CONFIG_SERVER_URL:http://localhost:8888}
39 changes: 39 additions & 0 deletions admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,49 @@

<build>
<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.26.0</version>
<extensions>true</extensions>
<configuration>
<verbose>true</verbose>
<images>
<image>
<name>${project.artifactId}:${project.version}</name>
<build>
<from>adoptopenjdk/openjdk11</from>
<entryPoint>
<exec>
<args>java</args>
<args>-jar</args>
<args>/maven/${project.artifactId}-${project.version}.jar</args>
</exec>
</entryPoint>
<assembly>
<descriptorRef>artifact</descriptorRef>
</assembly>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build</id>
<phase>post-integration-test</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
4 changes: 2 additions & 2 deletions admin-server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: 8508
port: ${SERVER_PORT:8508}

spring:
application:
Expand All @@ -14,7 +14,7 @@ eureka:
client:
registryFetchIntervalSeconds: 5
serviceUrl:
defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8500}/eureka/
defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8500}/eureka/}

management:
endpoints:
Expand Down
6 changes: 3 additions & 3 deletions common-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
<groupId>com.mehmetpekdemir</groupId>
<artifactId>microservice-app</artifactId>
<version>1.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>


<dependencies>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-cassandra</artifactId>
Expand All @@ -33,7 +33,7 @@
<artifactId>metrics-core</artifactId>
<version>3.0.2</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
48 changes: 46 additions & 2 deletions config-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,73 @@
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>

<artifactId>config-server</artifactId>
<name>config-server</name>
<description>Config Server</description>
<packaging>jar</packaging>

<parent>
<groupId>com.mehmetpekdemir</groupId>
<artifactId>microservice-app</artifactId>
<version>1.0.1</version>
<relativePath />
<relativePath>../pom.xml</relativePath>
</parent>

<dependencies>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>

</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.26.0</version>
<extensions>true</extensions>
<configuration>
<verbose>true</verbose>
<images>
<image>
<name>${project.artifactId}:${project.version}</name>
<build>
<from>adoptopenjdk/openjdk11</from>
<entryPoint>
<exec>
<args>java</args>
<args>-jar</args>
<args>/maven/${project.artifactId}-${project.version}.jar</args>
</exec>
</entryPoint>
<assembly>
<descriptorRef>artifact</descriptorRef>
</assembly>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build</id>
<phase>post-integration-test</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
5 changes: 4 additions & 1 deletion config-server/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
server:
port: 8888
port: ${SERVER_PORT:8888}

spring:
cloud:
config:
server:
git:
uri:
native:
search-locations: classpath:/microserviceconfig

profiles:
active: native
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ spring:
application:
name: account-service
zipkin:
base-url: http://localhost:9411/
base-url: ${ZIPKIN_SERVER_URL:http://localhost:9411}

boot:
admin:
client:
url: http://localhost:8508
url: ${SPRING_BOOT_ADMIN_SERVER_URL:http://localhost:8508}

management:
endpoints:
Expand All @@ -22,20 +22,25 @@ management:
spcloud:
cassandra:
keyspace:
name: springcloud
port: 9042
name: ${CASSANDRA_SERVER_KEYSPACE:springcloud}

port: ${CASSANDRA_SERVER_PORT:9042}

contact:
point: 127.0.0.1
point: ${CASSANDRA_SERVER_HOST:localhost}

getEntityBasePackages: com.mehmetpekdemir.commonservice
username: cassandra
password: cassandra

username: ${CASSANDRA_SERVER_USERNAME:cassandra}
password: ${CASSANDRA_SERVER_USERNAME:cassandra}


eureka:
client:
instance:
hostname: localhost
hostname: ${EUREKA_SERVER_HOSTNAME:localhost}

serviceUrl:
defaultZone: http://localhost:8500/eureka/
defaultZone: ${EUREKA_SERVER_URL:http://localhost:8500/eureka/}


Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ server:
spring:
application:
name: eureka-server

zipkin:
base-url: http://localhost:9411/
base-url: ${ZIPKIN_SERVER_URL:http://localhost:9411/}

boot:
admin:
client:
url: http://localhost:8508
url: ${SPRING_BOOT_ADMIN_SERVER_URL:http://localhost:8508}

management:
endpoints:
Expand All @@ -24,9 +25,9 @@ eureka:
server:
eviction-interval-timer-in-ms: 1000
instance:
hostname: localhost
hostname: ${EUREKA_SERVER_HOST:localhost}
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://localhost:8500/eureka/
defaultZone: ${EUREKA_SERVER_URL:http://localhost:8500/eureka/}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spring:
boot:
admin:
client:
url: http://localhost:8508
url: ${SPRING_BOOT_ADMIN_SERVER_URL:http://localhost:8508}

management:
endpoints:
Expand All @@ -35,6 +35,6 @@ management:
eureka:
client:
instance:
hostname: localhost
hostname: ${EUREKA_SERVER_HOST:localhost}
serviceUrl:
defaultZone: http://localhost:8500/eureka/
defaultZone: ${EUREKA_SERVER_URL:http://localhost:8500/eureka/}
Loading

0 comments on commit 0b61792

Please sign in to comment.