Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.gradle
build
out
target
*.iml
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ jobs:
run: |
docker pull ${{ env.DOCKER_IMAGE_NAME }}:latest || true

- name: Run tests (Testcontainers, Spring REST Docs)
run: ./gradlew test --no-daemon

- name: Build JAR
run: ./gradlew bootJar --no-daemon

- name: Build the Docker image with cache
run: |
docker build . --file Dockerfile --tag ${{ env.DOCKER_IMAGE_NAME }}:latest \
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Build and Test with Coverage
on:
pull_request:
branches:
- main
- develop

jobs:
Expand Down
20 changes: 2 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
# 1단계: 빌드 환경 (Gradle 빌드)
FROM gradle:7.4.2-jdk17 AS builder


WORKDIR /app
COPY gradlew .
COPY gradle gradle
COPY build.gradle .
COPY settings.gradle .

RUN chmod +x ./gradlew
RUN ./gradlew dependencies

COPY src src
RUN ./gradlew bootJar --no-daemon

# 2단계: 실행 환경 (최종 실행 이미지만 남김)
# 실행 환경 (최종 실행 이미지만 남김)
FROM openjdk:17-jdk-slim

WORKDIR /app
COPY --from=builder /app/build/libs/*.jar /app/moddo.jar
COPY build/libs/*.jar /app/moddo.jar
ENTRYPOINT ["java", "-Dspring.profiles.active=prod", "-jar", "moddo.jar"]
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ build {
bootJar {
dependsOn asciidoctor
from("${asciidoctor.outputDir}") {
into 'src/main/resources/static/docs'
into 'static/docs'
}
}
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ services:
- ./redis.conf:/etc/redis/redis.conf
- redis-data:/data
command: redis-server /etc/redis/redis.conf
networks:
- backend
networks:
backend:
driver: bridge
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring:
import: classpath:config/application-jwt.yml, classpath:config/application-s3.yml
jpa:
hibernate:
ddl-auto: create
ddl-auto: update
properties:
hibernate:
dialect: org.hibernate.dialect.MySQL8Dialect
Expand Down
Loading