-
Notifications
You must be signed in to change notification settings - Fork 6
[#109] AWS를 활용한 서버 배포 #110
base: main
Are you sure you want to change the base?
Conversation
Dockerfile
Outdated
@@ -0,0 +1,4 @@ | |||
FROM openjdk:11-jdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11-jdk 이미지가 정말 필요할까요??
이 태그의 도커 이미지의 크기가 얼마나 될까요??
서버를 실행시키기 위해 필요한 것만 딱 들어가있는 이미지는 없을까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
은수님과 방금 얘기를 나눠봤습니다.
jdk는 자바 개발도구 + 자발 실행을 담당하고, jre는 자바 실행을 위한 도구로 알고 있습니다.
jre를 사용하는 방법으로 진행해보겠습니다!
stage('Init') { | ||
steps { | ||
echo 'clear' | ||
sh 'docker stop $(docker ps -aq)' | ||
sh 'docker rm $(docker ps -aq)' | ||
sh 'docker rmi $(docker images -q)' | ||
deleteDir() | ||
} | ||
} | ||
|
||
stage('clone') { | ||
steps { | ||
git url: "$SOURCE_CODE_URL", | ||
branch: "$RELEASE_BRANCH", | ||
credentialsId: "$SOURCECODE_JENKINS_CREDENTIAL_ID" | ||
sh "ls -al" | ||
} | ||
} | ||
|
||
stage('dockerizing') { | ||
steps { | ||
sh "pwd" | ||
sh "chmod +x ./gradlew" | ||
sh "./gradlew build --stacktrace" | ||
|
||
sh "docker build -t foodeats ." | ||
} | ||
} | ||
|
||
stage('deploy') { | ||
steps { | ||
sh "docker-compose up --build -d" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
지금 이 순서로 배포를 하게 되면, git에서 클론 받고, gradle 빌드하고, dockerize하고, 다시 docker-compose up이 완료될 때 까지 서비스가 동작하지 않겠네요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 부분 생각치 못했습니다..
해당 문제점에 대한 해결책을 생각해보고 은수님과 스터디시간에 얘기를 나눈 뒤 수정할 수 있도록 하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
멘토님께서 피드백을 주셨듯이,
현재 방법은 배포 시 반드시 서비스를 중단해야하므로 무중단배포가 이뤄지지 않습니다.
이를 해결하기 위해 확실하지는 않지만 2가지 방법을 현재 알아보고 있습니다.
1. nginx를 활용한 방식
2. github actions를 활용한 방식
좀 더 알아보고 내일 멘토링 시간에 들어갈 수 있도록 하겠습니다!
@yusok7 @Maestro6788 |
AWS를 활용한 서버 배포 #109
AWS를 활용하여 FoodEats를 빌드 후 자동배포하는 작업을 진행했습니다.
이와 함께 nginx 로드밸런싱을 사용하여 요청을 분산할 수 있도록 해놨습니다.