Skip to content

M4 환경 구성을 위한 Docker 설정 및 Makefile 추가 #266 #267

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

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

42inshin
Copy link
Member

@42inshin 42inshin commented Apr 1, 2025

해당 사항 (중복 선택)

  • FEAT : 새로운 기능 추가 및 개선
  • FIX : 기존 기능 수정 및 정상 동작을 위한 간단한 추가, 수정사항
  • BUG : 버그 수정
  • REFACTOR : 결과의 변경 없이 코드의 구조를 재조정
  • TEST : 테스트 코드 추가
  • DOCS : 코드가 아닌 문서를 수정한 경우
  • REMOVE : 파일을 삭제하는 작업만 수행
  • RENAME : 파일 또는 폴더명을 수정하거나 위치(경로)를 변경
  • ETC : 이외에 다른 경우 - 어떠한 사항인지 작성해주세요.

설명

🔗 관련 이슈

해결한 이슈: closed #266

📝 작업 내용

  1. Backend Docker 환경 개선

    • M4 환경에 맞춰 Docker 및 compose 파일 수정
    • AWS 관련 불필요한 logback 의존성 제거
    • 서비스 간 의존성을 고려하여 healthcheck 순서를 보장하도록 수정
  2. Frontend Docker 환경 구성

    • Frontend 애플리케이션을 Docker에서 실행할 수 있도록 Dockerfile 추가
    • Frontend용 docker-compose.yml 파일 추가
    • package.json 수정하여 Docker 환경 대응
  3. 빌드 자동화

    • Frontend 빌드 자동화를 위한 Makefile 추가

🔍 상세 변경 내용

Backend

  • Docker 설정 파일 M4 환경에 맞게 수정
  • 불필요한 AWS logback 의존성 제거하여 환경 최적화

Frontend

  • src/frontend/Dockerfile 신규 작성
  • src/frontend/docker-compose.yml 신규 작성
  • src/frontend/package.json Docker 환경 설정 반영
  • src/makefile Frontend 빌드 자동화 스크립트 추가

🧪 테스트 방법

  1. Frontend 실행
cd src/frontend
docker compose up --build

또는 Makefile 사용해서 Frontend 실행/중지

# 컨테이너 up
make fe
# 컨테이너 down
make fe-down 

@42inshin 42inshin requested review from dahyun24, Copilot and KSK9820 April 1, 2025 08:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces Docker configuration improvements for both the backend and frontend environments and adds a Makefile to automate the frontend build process.

  • Updated Docker Compose files for backend services to include additional healthchecks and dependency conditions.
  • Added new Dockerfile and docker-compose.yml files for the frontend application.
  • Integrated a Makefile for automating the frontend container management.

Reviewed Changes

Copilot reviewed 9 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/frontend/docker-compose.yml Added configuration for the frontend container with necessary environment variables and volume mounts.
src/backend/user-server/docker-compose.yml Added a dependency on Redis with a healthcheck condition.
src/backend/redis/docker-compose.yml Introduced healthcheck configuration for the Redis container.
src/backend/main-server/main/docker-compose.yml Extended dependency conditions to include MySQL and Redis.
src/backend/kafka/docker-compose.yml Added healthcheck configurations for both Zookeeper and Kafka, with Kafka now depending on Zookeeper's health.
src/backend/elk/docker-compose-kibana.yml Updated Kibana healthcheck parameters and test command.
src/backend/elk/docker-compose-es.yml Modified the Elasticsearch healthcheck and added a platform specification for ARM64 issues.
src/backend/chat-server/docker-compose.yml Updated dependencies to ensure Kafka is healthy before starting chat service containers.
src/backend/auth-server/docker-compose.yml Added a dependency on Redis with a healthcheck condition.
Files not reviewed (11)
  • src/backend/chat-server/Dockerfile: Language not supported
  • src/backend/chat-server/src/main/resources/logback.xml: Language not supported
  • src/backend/file-server/Dockerfile: Language not supported
  • src/backend/history-server/Dockerfile: Language not supported
  • src/backend/main-server/main/Dockerfile: Language not supported
  • src/backend/main-server/main/src/main/resources/logback.xml: Language not supported
  • src/backend/signaling-server/Dockerfile: Language not supported
  • src/backend/state-server/Dockerfile: Language not supported
  • src/frontend/Dockerfile: Language not supported
  • src/frontend/package.json: Language not supported
  • src/makefile: Language not supported

test:
[
"CMD-SHELL",
'curl -s http://localhost:9200/_cluster/health | grep -vq ''"status":"red"''',
Copy link
Preview

Copilot AI Apr 1, 2025

Choose a reason for hiding this comment

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

The quoting in the Elasticsearch healthcheck command may not work as intended, which could fail to detect a 'red' status correctly. Consider revising the test command to use clearer quote escaping (e.g., 'grep -vq ""status":"red""') to ensure proper healthcheck evaluation.

Suggested change
'curl -s http://localhost:9200/_cluster/health | grep -vq ''"status":"red"''',
"curl -s http://localhost:9200/_cluster/health | grep -vq '\"status\":\"red\"'",

Copilot uses AI. Check for mistakes.

Copy link
Member Author

Choose a reason for hiding this comment

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

제안 전 코드로 healthcheck 되는 것을 확인했기 때문에 변경하지 않습니다.

@42inshin 42inshin requested a review from yoo-chris April 1, 2025 08:27
@sgdevcamp2025 sgdevcamp2025 locked and limited conversation to collaborators Apr 1, 2025
@sgdevcamp2025 sgdevcamp2025 unlocked this conversation Apr 1, 2025
@42inshin 42inshin self-assigned this Apr 1, 2025
@42inshin 42inshin added 🕹️BE 백엔드 작업 🖥️FE 프론트엔드 작업 infra 인프라 작업 labels Apr 1, 2025
Copy link
Collaborator

@dahyun24 dahyun24 left a comment

Choose a reason for hiding this comment

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

꼼꼼하게 docker 의존성 달아주시고~ healthy check에 프론트 dockerfile 까지!!! 수고하셨고 감사합니다 🙇

@@ -1,5 +1,5 @@
# 1️⃣ 베이스 이미지로 OpenJDK 17 사용
FROM openjdk:17-jdk-slim AS build
FROM amazoncorretto:17-alpine AS build

Copy link
Collaborator

Choose a reason for hiding this comment

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

이 버전이 M4에 맞는 버전이군요! 바꿔주셔서 감사합니다~ 😄

<!-- 개발 환경(dev, docker)에서는 콘솔 로깅만 사용 -->
<springProfile name="dev,docker,default">
<root level="INFO">
<appender-ref ref="console_log"/>
</root>
Copy link
Collaborator

Choose a reason for hiding this comment

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

prod 환경이랑 개발 환경이랑 나누는 방법 좋은데요!?! 이렇게 바꾸면 매번 파일 들어가서 수정할 일이 없을 것 같네요! 감사합니다 :)

[
"CMD-SHELL",
"curl -s -I http://localhost:5601/app/home | grep -q '200 OK'",
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

grep -q '200 OK'
제가 놓친 부분이었네요!

Copy link
Collaborator

@KSK9820 KSK9820 left a comment

Choose a reason for hiding this comment

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

M4에서 잘 동작합니다!
감사합니다!! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕹️BE 백엔드 작업 🖥️FE 프론트엔드 작업 infra 인프라 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[INFRA] M4 로컬 환경을 위한 dockerfile 수정
3 participants