Skip to content

Commit 6859098

Browse files
authored
Merge pull request #9 from Nasruddin/feature/elastic-search
Cleaning up
2 parents 126db5b + 4392b1b commit 6859098

File tree

29 files changed

+414
-56
lines changed

29 files changed

+414
-56
lines changed

.idea/compiler.xml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

api-gateway-service/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#stage 1
2+
#Start with a base image containing Java runtime
3+
FROM openjdk:11-slim as build
4+
5+
# Add Maintainer Info
6+
LABEL maintainer="Nasruddin <[email protected]>"
7+
8+
# The application's jar file
9+
ARG JAR_FILE
10+
11+
# Add the application's jar to the container
12+
COPY ${JAR_FILE} app.jar
13+
14+
#unpackage jar file
15+
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf /app.jar)
16+
17+
#stage 2
18+
#Same Java runtime
19+
FROM openjdk:11-slim
20+
21+
#Add volume pointing to /tmp
22+
VOLUME /tmp
23+
24+
#Copy unpackaged application to new container
25+
ARG DEPENDENCY=/target/dependency
26+
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
27+
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
28+
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
29+
30+
#execute the application
31+
ENTRYPOINT ["java","-cp","app:app/lib/*","com.javatab.gatewayservice.ApiGatewayServiceApplication"]

api-gateway-service/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>com.javatab</groupId>
1212
<artifactId>api-gateway-service</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
13+
<version>1.0.0</version>
1414
<name>api-gateway-service</name>
1515
<description>Gateway Service using spring cloud gateway</description>
1616
<properties>

auth-service/src/main/resources/application.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ spring:
2626
# max-attempts: 3
2727

2828
datasource:
29-
url: jdbc:postgresql://localhost:5432/testdb
29+
url: jdbc:postgresql://postgres_container1:5432/testdb
3030
username: postgres
3131
password: 123
32+
driver-class-name: org.postgresql.Driver
3233
jpa:
3334
properties:
3435
hibernate:

config-server/src/main/resources/application.yml renamed to config-server/src/main/resources/bootstrap.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ management:
2424
include: "*"
2525

2626
eureka:
27+
instance:
28+
prefer-ip-address: true
2729
client:
2830
service-url:
29-
default-zone: http://discoveryservice:8761/eureka/
31+
defaultZone: ${EUREKA_SERVER:http://localhost:8761/eureka}
32+
fetch-registry: true
33+
register-with-eureka: true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: "3.8"
2+
services:
3+
elasticsearch:
4+
image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
5+
container_name: elasticsearch
6+
environment:
7+
- node.name=elasticsearch
8+
- discovery.type=single-node
9+
- cluster.name=docker-cluster
10+
- bootstrap.memory_lock=true
11+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
12+
ulimits:
13+
memlock:
14+
soft: -1
15+
hard: -1
16+
# volumes:
17+
# - esdata1:/usr/share/elasticsearch/data
18+
ports:
19+
- "9300:9300"
20+
- "9200:9200"
21+
networks:
22+
- backend
23+
24+
networks:
25+
backend:
26+
driver: bridge
27+
28+
#volumes:
29+
# esdata1:
30+
# driver: local

0 commit comments

Comments
 (0)