Skip to content

Commit

Permalink
chore: Dockerfile 방식에서 docker-compose 방식으로 대체
Browse files Browse the repository at this point in the history
  • Loading branch information
EunChanNam committed Dec 7, 2023
1 parent 3910ec9 commit 435b952
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 279 deletions.
18 changes: 4 additions & 14 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
distribution: 'temurin'
java-version: '17'

- name: application.yml 파일 생성
run: echo "${{ secrets.APPLICATION_ENV }}" > ./src/main/resources/application-prod.yml

- name: Gradle 명령 실행을 위해 권한을 부여한다
run: chmod +x gradlew

Expand All @@ -32,23 +35,10 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: 환경변수 파일 생성
run: echo "${{ secrets.APPLICATION_ENV }}" > ./.env

- name: ubuntu Docker image build and push
- name: Docker 이미지 빌드 & 푸쉬
run: |
docker-compose -f ./docker-compose.yml build
docker-compose -f ./docker-compose.yml push
# - name: ubuntu Docker image build
# run: docker build -t ${{ secrets.DOCKER_NAME }}/we-share-wish-hair:latest -f Dockerfile-server .
#
# - name: Redis Docker image build
# run: docker build -t ${{ secrets.DOCKER_NAME }}/we-share-wish-hair:redis -f Dockerfile-redis .
#
# - name: ubuntu docker Hub 푸쉬
# run: docker push ${{ secrets.DOCKER_NAME }}/we-share-wish-hair:latest
# - name: Redis docker Hub 푸쉬
# run: docker push ${{ secrets.DOCKER_NAME }}/we-share-wish-hair:redis
- name: Deploy with push
uses: appleboy/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build/
!**/src/main/**/build/
!**/src/test/**/build/
/src/main/generated/
src/main/resources/application*.yml

### sql ###
**/src/main/resources/sql/
Expand Down
6 changes: 1 addition & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ services:
server:
image: openjdk:17-alpine
restart: always
env_file:
- .env
volumes:
- ./build/libs:/home
command: ["java", "-jar",
"-Dspring.profiles.active=prod",
"/home/advanced-we-share-wish-hair-0.0.1-SNAPSHOT.jar"]
command: ["java", "-jar", "-Dspring.profiles.active=prod", "/home/advanced-we-share-wish-hair-0.0.1-SNAPSHOT.jar"]
ports:
- '8080:8080'
platform: linux/amd64
Expand Down
91 changes: 0 additions & 91 deletions src/main/resources/application-dev.yml

This file was deleted.

82 changes: 0 additions & 82 deletions src/main/resources/application-prod.yml

This file was deleted.

87 changes: 0 additions & 87 deletions src/main/resources/application.yml

This file was deleted.

0 comments on commit 435b952

Please sign in to comment.