-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IDLE-248] config: Dockerfile 수정 및 shell script 추가
- fargate 동작시, eureka 서버에 private ip가 아닌 메타데이터의 ip가 등록된다. - shell script를 통해 런타임 시점에서 메타데이터 ip에 등록된 private ip를 가져오도록 함. - with @0112leesy
- Loading branch information
Showing
4 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
FROM openjdk:21-ea-17-jdk-slim | ||
COPY build/libs/book-service-0.0.1-SNAPSHOT.jar book-service.jar | ||
CMD ["java", "-jar", "book-service.jar"] | ||
|
||
RUN apt update && apt install curl -y && apt install jq -y | ||
COPY entrypoint.sh /usr/local/bin/ | ||
|
||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
response=$(curl -s ${ECS_CONTAINER_METADATA_URI_V4}) | ||
export ECS_INSTANCE_IP_ADDRESS=$(echo $response | jq -r '.Networks[0].IPv4Addresses[0]') | ||
echo $ECS_INSTANCE_IP_ADDRESS | ||
|
||
java -jar book-service.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
FROM openjdk:21-ea-17-jdk-slim | ||
COPY build/libs/user-service-0.0.1-SNAPSHOT.jar user-service.jar | ||
CMD ["java", "-jar", "user-service.jar"] | ||
|
||
RUN apt update && apt install curl -y && apt install jq -y | ||
COPY entrypoint.sh /usr/local/bin/ | ||
|
||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
response=$(curl -s ${ECS_CONTAINER_METADATA_URI_V4}) | ||
export ECS_INSTANCE_IP_ADDRESS=$(echo $response | jq -r '.Networks[0].IPv4Addresses[0]') | ||
echo $ECS_INSTANCE_IP_ADDRESS | ||
|
||
java -jar user-service.jar |