Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BSVR-25] docker-compose 추가 #7

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ subprojects {
}

tasks.register<Exec>("makeGitHooksExecutable") {
commandLine("chmod", "+x", "${rootProject.rootDir}/.git/hooks/pre-commit")
if (System.getProperty("os.name").contains("Windows")) {
commandLine("attrib", "+x", "${rootProject.rootDir}/.git/hooks/pre-commit")
} else {
commandLine("chmod", "+x", "${rootProject.rootDir}/.git/hooks/pre-commit")
}
dependsOn("updateGitHooks")
}

Expand Down
24 changes: 24 additions & 0 deletions docker/docker-compose.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spring boot 도커파일 (java -jar 명령어 등)이 따로 없는데 이거 실행 잘 돌아가?
그냥 우분투 서버만 올라가고, 스프링은 실행 안 될 것 같아!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spring 실행이랑 다른 스크립트?는 아예 작성 안 했어
지금 우분투 서버만 올라게 되있는 건 맞아

java -jar SPOT-server-0.0.1.jar 이런식으로라두 써둘까??

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 도커 파일은 언제 작업할 계획이야? 지라 상으로는 compose 세팅만 있고 도커 파일 세팅은 없어서!
spring 어플리케이션을 실행하려는 목적이라서 지금처럼 docker-compose만 있으면 안 될 것 같아~~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 도커 컴포즈도 첨이긴 했는데 도커 파일은 한 번도 안 해봐서... 음 내일 좀 더 찾아보고 해봐도 괜찮을까...?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

웅 도커 파일 추가하고 스프링 도커로 실행 되는 것까지 해서 언제까지 될지 일정 알려줘~ 지라 티켓 기한도 수정해주고!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 PR은 draft 상태로 바꾸고, 작업 완료 되면 그때 다시 리뷰 상태로 바꾸면 될 듯 해~ 💪

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오키오키!

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# docker-compose.yml

services:
mysql:
container_name: SPOT-db
image: mysql:8 # 선호하는 버전 있을 경우 선정 예정!
ports:
- 3306:3306 # 혹시나 기존에 MySQL 사용 중일 경우 앞자리를 다른 포트로 바꿔야함.
volumes:
- ./db/mysql/data:/var/lib/mysql # 기존 데이터 파일과 격리를 위해 db/mysql/data 로 설정함!
Comment on lines +9 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 데이터 파일 << 이 혹시 어떤 파일이야?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기존 데이터 파일 << 이 혹시 어떤 파일이야?

정확하게 기억나진 않는데, MySQL을 이미 사용하고 있으면
./mysql 에 원래 사용하던 데이터가 들어갔던 거로 기억해서 혹시나해서 분리하는 게 좋지 않을까? 저렇게 뒀어

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

컨테이너 볼륨이 실제 로컬 MySQL 저장소랑 겹치지 않게 사용했다는 의미인거지?
근데 ./mysql이면 현재 경로 (SPOT-server 루트) 내부에 mysql 디렉터리인거 아니야?.?

(볼륨 구조에 이견이 있는건 아닌데, 주석이 조금 이해가 안되어서 코멘트 남긴다! 변경할 필요는 없어~~)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음 주석은 조금 수정하는 게 좋긴 하겠다..ㅎㅎ

command:
- '--character-set-server=utf8mb4'
- '--collation-server=utf8mb4_unicode_ci'
environment:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

타임존 세팅도 추가하면 좋을 듯!

MYSQL_DATABASE: spot # DB 이름 선정 시 변경 예정.
MYSQL_USER: test1234 # 임시 유저
MYSQL_PASSWORD: test1234 # 임시 비밀번호
Comment on lines +15 to +17
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DB 컨테이너는 NCP 세팅 전까지 로컬 개발용으로 쓸거라서 따로 환경변수로 안뽑은거 맞을까~?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DB 컨테이너는 NCP 세팅 전까지 로컬 개발용으로 쓸거라서 따로 환경변수로 안뽑은거 맞을까~?

응응 어차피 임시용인데, 그것도 환경변수로 뺄 필요가 있을까? 싶었어!

server:
container_name: SPOT-server
image: ubuntu:20.04
ports:
- 80:80 # 80번 - 80번 매칭
Comment on lines +21 to +22
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

80번 포트를 쓰는 이유가 혹시 있을까? 기본은 8080으로 알고있어서!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어 음... 80번 포트로 하면 URL 접속할 때 편해서 계속 그렇게 썼어서 저렇게 했어..ㅎㅎ

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스프링은 80에서 띄우려면 root 계정을 사용해야한다고 알고있어!
특별한 이유가 없다면 8080을 쓰는 것 어때?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 오키오키! 바꿔둘게

volumes:
- ./app:./app