File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CD
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Login to DockerHub
17+ run : echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
18+
19+ - name : Extract Docker image metadata
20+ id : meta
21+ uses : docker/metadata-action@v5
22+ with :
23+ images : dungbik/flipnote-user
24+ - name : Build and push Docker image
25+ uses : docker/build-push-action@v6
26+ with :
27+ context : .
28+ push : true
29+ tags : ${{ steps.meta.outputs.tags }}
30+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1- # Build stage
2- FROM gradle:8.11-jdk21 AS build
1+ FROM gradle:8-jdk21 AS build
32WORKDIR /app
3+
44COPY build.gradle.kts settings.gradle.kts ./
5- COPY gradle ./gradle
65COPY src ./src
6+
77RUN gradle bootJar --no-daemon
88
9- # Runtime stage
10- FROM eclipse-temurin:21-jre-alpine
9+ FROM eclipse-temurin:21-jre
1110WORKDIR /app
1211
13- RUN addgroup -S appgroup && adduser -S appuser -G appgroup
14- USER appuser
12+ ENV TZ=Asia/Seoul
13+ RUN apt-get update \
14+ && apt-get install -y tzdata \
15+ && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
16+ && echo $TZ > /etc/timezone \
17+ && rm -rf /var/lib/apt/lists/*
1518
16- COPY --from=build /app/build/libs/*. jar app.jar
19+ COPY --from=build /app/build/libs/user-0.0.1-SNAPSHOT. jar .
1720
18- EXPOSE 8081
21+ EXPOSE 8080
1922
20- ENTRYPOINT ["java" , "-jar" , "app .jar" ]
23+ ENTRYPOINT ["java" , "-jar" , "user-0.0.1-SNAPSHOT .jar" ]
Original file line number Diff line number Diff line change 33 name : user
44
55 datasource :
6- url : ${DB_URL:jdbc:mysql://localhost:3306/flipnote }
6+ url : ${DB_URL:jdbc:mysql://localhost:3306/flipnote_user }
77 username : ${DB_USERNAME:root}
88 password : ${DB_PASSWORD:root}
99 driver-class-name : com.mysql.cj.jdbc.Driver
You can’t perform that action at this time.
0 commit comments