Skip to content

Commit

Permalink
v2.1.1
Browse files Browse the repository at this point in the history
v2.1.1
  • Loading branch information
mikekks authored Sep 27, 2024
2 parents 7369ea5 + 30ec1a0 commit 74b2f18
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: docker image 빌드 및 푸시 (Spring)
run: |
docker build --platform linux/amd64 -t makerscrew/main:develop .
docker build --platform linux/amd64 -t makerscrew/main:develop --build-arg SPRING_PROFILES_ACTIVE=dev .
docker push makerscrew/main:develop
working-directory: ${{ env.working-directory-spring }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: docker image 빌드 및 푸시 (Spring)
run: |
docker build --platform linux/amd64 -t makerscrew/main:production .
docker build --platform linux/amd64 -t makerscrew/main:production --build-arg SPRING_PROFILES_ACTIVE=prod .
docker push makerscrew/main:production
working-directory: ${{ env.working-directory-spring }}

Expand Down
20 changes: 19 additions & 1 deletion main/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,22 @@ FROM openjdk:17-jdk-slim
WORKDIR /app
COPY --from=build /app/build/libs/*.jar app.jar

ENTRYPOINT ["java","-jar","/app/app.jar"]
ARG SPRING_PROFILES_ACTIVE

# Default values
ENV AGENT_ID="agent-in-docker"
ENV APPLICATION_NAME="spring"

# Set environment variables based on the active profile
RUN if [ "$SPRING_PROFILES_ACTIVE" = "dev" ]; then \
AGENT_ID="dev-agent"; \
APPLICATION_NAME="spring-dev"; \
elif [ "$SPRING_PROFILES_ACTIVE" = "prod" ]; then \
AGENT_ID="prod-agent"; \
APPLICATION_NAME="spring-prod"; \
fi && \
echo "Using AGENT_ID=$AGENT_ID and APPLICATION_NAME=$APPLICATION_NAME"

ENV JAVA_OPTS="-javaagent:/pinpoint-agent/pinpoint-bootstrap-2.5.3.jar -Dpinpoint.agentId=$AGENT_ID -Dpinpoint.applicationName=$APPLICATION_NAME -Dpinpoint.profiler.profiles.active=release"

ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar /app/app.jar"]

0 comments on commit 74b2f18

Please sign in to comment.