Skip to content

Commit 19dce45

Browse files
committed
feat: dockerfile
1 parent 584fb57 commit 19dce45

File tree

18 files changed

+45
-21
lines changed

18 files changed

+45
-21
lines changed

apigateway-service/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM openjdk:17-ea-11-jdk-slim
2+
VOLUME /tmp
3+
COPY target/apigateway-service-1.0.jar ApigatewayService.jar
4+
ENTRYPOINT ["java","-jar","ApigatewayService.jar"]

apigateway-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>com.example</groupId>
1212
<artifactId>apigateway-service</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
13+
<version>1.0</version>
1414
<name>apigateway-service</name>
1515
<description>apigateway-service</description>
1616
<properties>

catalog-service/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM openjdk:17-ea-11-jdk-slim
2+
VOLUME /tmp
3+
COPY target/catalog-service-1.0.jar CatalogService.jar
4+
ENTRYPOINT ["java","-jar","CatalogService.jar"]

catalog-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>com.example</groupId>
1212
<artifactId>catalog-service</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
13+
<version>1.0</version>
1414
<name>catalog-service</name>
1515
<description>catalog-service</description>
1616
<properties>

catalog-service/src/main/java/com/example/catalogservice/messagequeue/KafkaConsumerConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class KafkaConsumerConfig {
1919
@Bean
2020
public ConsumerFactory<String, String> consumerFactory(){
2121
Map<String, Object> properties = new HashMap<>();
22-
properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "127.0.0.1:9092");
22+
properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "172.18.0.101:9092");
2323
properties.put(ConsumerConfig.GROUP_ID_CONFIG, "consumerGroupId");
2424
properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
2525
properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);

config-service/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM openjdk:17-ea-11-jdk-slim
2+
VOLUME /tmp
3+
COPY apiEncryptionKey.jks apiEncryptionKey.jks
4+
COPY target/config-service-1.0.jar ConfigServer.jar
5+
ENTRYPOINT ["java","-jar","ConfigServer.jar"]

config-service/apiEncryptionKey.jks

2.7 KB
Binary file not shown.

config-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>com.example</groupId>
1212
<artifactId>config-service</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
13+
<version>1.0</version>
1414
<name>config-service</name>
1515
<description>config-service</description>
1616
<properties>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
encrypt:
22
# key: abcdefghijklmnopqrstuvwxyz0123456789
33
key-store:
4-
location: file:///Users/jasun/Desktop/develop/keystore/apiEncryptionKey.jks
4+
# location: file:///Users/jasun/Desktop/develop/keystore/apiEncryptionKey.jks
5+
location: file://apiEncryptionKey.jks
56
password: test1234
6-
alias : apiEncryptionKey
7+
alias : apiEncryptionKey

discoveryservice/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM openjdk:17-ea-11-jdk-slim
2+
VOLUME /tmp
3+
COPY target/discoveryservice-1.0.jar DiscoveryService.jar
4+
ENTRYPOINT ["java","-jar","DiscoveryService.jar"]

discoveryservice/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>com.example</groupId>
1212
<artifactId>discoveryservice</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
13+
<version>1.0</version>
1414
<name>discoveryservice</name>
1515
<description>discoveryservice</description>
1616

discoveryservice/src/main/resources/application.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ server:
44
spring:
55
application:
66
name: discoveryservice
7+
cloud:
8+
config:
9+
uri: http://127.0.0.1:8888
10+
name: ecommerce
711
eureka:
812
client:
913
register-with-eureka: false

order-service/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM openjdk:17-ea-11-jdk-slim
2+
VOLUME /tmp
3+
COPY target/order-service-1.0.jar OrderSerivce.jar
4+
ENTRYPOINT ["java","-jar","OrderSerivce.jar"]

order-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111
<groupId>com.example</groupId>
1212
<artifactId>order-service</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
13+
<version>1.0</version>
1414
<name>order-service</name>
1515
<description>order-service</description>
1616
<properties>

order-service/src/main/java/com/example/orderservice/controller/OrderController.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public ResponseEntity<ResponseOrder> createOrder(@PathVariable("userId") String
5656
// orderDto.setTotalPrice(orderDetails.getQty() * orderDetails.getUnitPrice());
5757

5858
/* send this order to the kafka */
59-
// kafkaProducer.send("example-catalog-topic", orderDto);
59+
kafkaProducer.send("example-catalog-topic", orderDto);
6060
// orderProducer.send("orders", orderDto);
6161

6262
// ResponseOrder responseOrder = mapper.map(orderDto, ResponseOrder.class);
@@ -75,15 +75,12 @@ public ResponseEntity<List<ResponseOrder>> getOrder(@PathVariable("userId") Stri
7575
result.add(new ModelMapper().map(v, ResponseOrder.class));
7676
});
7777

78-
try{
79-
Thread.sleep(1000);
80-
throw new Exception("장애 발생");
81-
}catch (InterruptedException e){
82-
log.warn(e.getMessage());
83-
}
84-
85-
86-
78+
// try{
79+
// Thread.sleep(1000);
80+
// throw new Exception("장애 발생");
81+
// }catch (InterruptedException e){
82+
// log.warn(e.getMessage());
83+
// }
8784

8885
log.info("After retrieve orders data");
8986

order-service/src/main/java/com/example/orderservice/messagequeue/KafkaProducerConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class KafkaProducerConfig {
1919
@Bean
2020
public ProducerFactory<String, String> producerFactory(){
2121
Map<String, Object> properties = new HashMap<>();
22-
properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "127.0.0.1:9092");
22+
properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "172.18.0.101:9092");
2323
properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
2424
properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
2525

user-service/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
FROM openjdk:17-ea-11-jdk-slim
22
VOLUME /tmp
33
COPY target/user-service-1.0.jar UserService.jar
4-
ENTRYPOINT ["java","-jar","-UserService.jar"]
4+
ENTRYPOINT ["java","-jar","UserService.jar"]

user-service/src/main/java/com/example/userservice/security/WebSecurity.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class WebSecurity {
2525

2626
@Bean
2727
public AuthenticationManager authenticationManager() throws Exception{
28+
2829
return this.authenticationConfiguration.getAuthenticationManager();
2930
}
3031

@@ -37,7 +38,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
3738
http.authorizeRequests()
3839
.antMatchers("/error/**").permitAll()
3940
.antMatchers("/**")
40-
.access("hasIpAddress('127.0.0.1')")
41+
.access("hasIpAddress(env.getProperty(\"gateway.ip\"))")
4142
.and()
4243
.addFilter(getAuthenticationFiler());
4344

0 commit comments

Comments
 (0)