Skip to content

Commit

Permalink
Merge pull request #83 from PUDDY-sp/dev
Browse files Browse the repository at this point in the history
cicd 완료 ...
  • Loading branch information
Jang99u authored Feb 10, 2024
2 parents 8dd6d64 + 67681fa commit 1d9928e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Login to DockerHub
uses: docker/[email protected]
with:
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v4
with:
file: ../../Dockerfile
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_PROD_REPONAME }}:0.0.1

Expand All @@ -59,9 +59,9 @@ jobs:
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ 22 }}
script: |
docker compose down
docker image prune -a
docker compose up
docker compose up -d
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
FROM openjdk:17
COPY /build/libs/puddy-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=prod"]
# FROM openjdk:17
# WORKDIR /app
# COPY ./build/libs/puddy-0.0.1-SNAPSHOT.jar app.jar
# ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=prod"]

FROM gradle:8.5-jdk17 AS builder
COPY . /usr/src
WORKDIR /usr/src
RUN gradle wrapper --gradle-version 8.5
RUN ./gradlew clean build -x test

FROM openjdk:17-jdk-alpine
COPY --from=builder /usr/src/build/libs/puddy-0.0.1-SNAPSHOT.jar /usr/app/app.jar
ENTRYPOINT ["java", "-jar", "/usr/app/app.jar", "--spring.profiles.active=prod"]

0 comments on commit 1d9928e

Please sign in to comment.