-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 프론트 서버 docker compose 구성 - 프론트 서버 CI / CD 구현
- Loading branch information
Showing
10 changed files
with
87 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,14 +54,22 @@ jobs: | |
echo "IMAGE_TAG=$version" >> $GITHUB_ENV | ||
working-directory: ./server | ||
|
||
- name: Docker Image Build | ||
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.PROJECT_NAME }}:${{ env.IMAGE_TAG }} . | ||
- name: Docker Sever Image Build | ||
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.SERVER_PROJECT_NAME }}:${{ env.IMAGE_TAG }} . | ||
working-directory: ./server | ||
|
||
- name: DockerHub Push | ||
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.PROJECT_NAME }}:${{ env.IMAGE_TAG }} | ||
- name: DockerHub Server Push | ||
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.SERVER_PROJECT_NAME }}:${{ env.IMAGE_TAG }} | ||
working-directory: ./server | ||
|
||
- name: Docker Client Image Build | ||
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.CLIENT_PROJECT_NAME }} . | ||
working-directory: ./client | ||
|
||
- name: DockerHub Client Push | ||
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.CLIENT_PROJECT_NAME }} | ||
working-directory: ./client | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
|
@@ -85,7 +93,7 @@ jobs: | |
key: ${{ secrets.EC2_KEY }} | ||
port: ${{ secrets.EC2_SSH_PORT }} | ||
source: "./docker-compose.yaml" | ||
target: "./talkka/git/E2E2-TALKKA" | ||
target: ${{ secrets.SCP_TARGET_PATH }} | ||
|
||
- name: Application Run | ||
uses: appleboy/[email protected] | ||
|
@@ -98,11 +106,16 @@ jobs: | |
|
||
script: | | ||
cd ./talkka/git/E2E2-TALKKA | ||
docker kill ${{ secrets.PROJECT_NAME }} | ||
docker rm -f ${{ secrets.PROJECT_NAME }} | ||
docker images -q ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.PROJECT_NAME }} | xargs -r docker rmi | ||
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.PROJECT_NAME }}:${{ env.IMAGE_TAG }} | ||
docker compose up -d --no-deps ${{ secrets.PROJECT_NAME }} | ||
docker kill ${{ secrets.SERVER_PROJECT_NAME }} ${{ secrets.CLIENT_PROJECT_NAME }} | ||
docker rm -f ${{ secrets.SERVER_PROJECT_NAME }} ${{ secrets.CLIENT_PROJECT_NAME }} | ||
docker images -q ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.SERVER_PROJECT_NAME }} | xargs -r docker rmi | ||
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.SERVER_PROJECT_NAME }}:${{ env.IMAGE_TAG }} | ||
docker images -q ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.CLIENT_PROJECT_NAME }} | xargs -r docker rmi | ||
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.CLIENT_PROJECT_NAME }} | ||
docker compose up -d --no-deps ${{ secrets.SERVER_PROJECT_NAME }} ${{ secrets.CLIENT_PROJECT_NAME }} | ||
- name: Remove GitHub Actions IP | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# local로 개발시 사용 | ||
#NEXT_PUBLIC_SERVER_URL=http://localhost:8080 | ||
|
||
# 배포시 사용 | ||
NEXT_PUBLIC_SERVER_URL=https://talkka-bus.duckdns.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 가져올 이미지를 정의 | ||
FROM node:20.12 | ||
# 경로 설정하기 | ||
WORKDIR /app | ||
# package.json 워킹 디렉토리에 복사 (.은 설정한 워킹 디렉토리를 뜻함) | ||
COPY package.json . | ||
# 명령어 실행 (의존성 설치) | ||
RUN npm install --legacy-peer-deps | ||
RUN npm install -g serve | ||
# 현재 디렉토리의 모든 파일을 도커 컨테이너의 워킹 디렉토리에 복사한다. | ||
COPY . . | ||
RUN npm run build | ||
|
||
# 각각의 명령어들은 한줄 한줄씩 캐싱되어 실행된다. | ||
# package.json의 내용은 자주 바뀌진 않을 거지만 | ||
# 소스 코드는 자주 바뀌는데 | ||
# npm install과 COPY . . 를 동시에 수행하면 | ||
# 소스 코드가 조금 달라질때도 항상 npm install을 수행해서 리소스가 낭비된다. | ||
|
||
EXPOSE 3000 | ||
|
||
# npm start 스크립트 실행 | ||
ENTRYPOINT ["npm","run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
server/src/main/java/com/talkka/server/oauth/controller/BaseController.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters