Skip to content

Commit eb589da

Browse files
authored
Merge pull request #147 from pr-ism/chore/146
Docker 적용
2 parents 54bab92 + 07a6d78 commit eb589da

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

.dockerignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.git
2+
.gitignore
3+
.gradle
4+
build/
5+
!gradle/wrapper/gradle-wrapper.jar
6+
.idea
7+
.vscode
8+
*.iml
9+
*.ipr
10+
*.iws
11+
.DS_Store
12+
Thumbs.db
13+
*.log
14+
logs/
15+
.jacoco
16+
docs/
17+
*.md
18+
!README.md
19+
.github
20+
.env
21+
.env.local

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM amazoncorretto:21 AS builder
2+
WORKDIR /app
3+
4+
COPY gradlew ./
5+
COPY build.gradle settings.gradle lombok.config ./
6+
COPY gradle ./gradle
7+
8+
RUN chmod +x gradlew && ./gradlew dependencies --no-daemon || true
9+
10+
COPY src ./src
11+
RUN ./gradlew clean bootJar -x test -x copyApiDocument --no-daemon
12+
13+
FROM amazoncorretto:21-al2023-headless
14+
WORKDIR /app
15+
16+
RUN (command -v dnf && dnf install -y shadow-utils && dnf clean all) || \
17+
(yum install -y shadow-utils && yum clean all) && \
18+
groupadd -r appuser && \
19+
useradd -r -g appuser appuser
20+
21+
COPY --from=builder /app/build/libs/*.jar app.jar
22+
RUN chown appuser:appuser app.jar
23+
24+
USER appuser
25+
EXPOSE 8080
26+
27+
ENTRYPOINT ["sh", "-c", "\
28+
exec java \
29+
-javaagent:${PINPOINT_AGENT_PATH}/pinpoint-bootstrap-${PINPOINT_AGENT_VERSION}.jar \
30+
-Dpinpoint.agentId=${PINPOINT_AGENT_ID} \
31+
-Dpinpoint.applicationName=${PINPOINT_APPLICATION_NAME} \
32+
-Dpinpoint.config=${PINPOINT_AGENT_PATH}/pinpoint-root.config \
33+
-Dprofiler.transport.grpc.collector.ip=${PINPOINT_COLLECTOR_IP} \
34+
-Dprofiler.transport.grpc.collector.connect.timeout=${PINPOINT_CONNECT_TIMEOUT} \
35+
-Dprofiler.transport.grpc.collector.request.timeout=${PINPOINT_REQUEST_TIMEOUT} \
36+
-Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} \
37+
${JAVA_OPTS} \
38+
-jar app.jar \
39+
"]

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ java {
1515
}
1616
}
1717

18+
tasks.named('jar') {
19+
enabled = false
20+
}
21+
1822
configurations {
1923
compileOnly {
2024
extendsFrom annotationProcessor

0 commit comments

Comments
 (0)