Skip to content

Conversation

ezcolin2
Copy link
Collaborator

@ezcolin2 ezcolin2 commented Jan 14, 2025

🔖 연관된 이슈

📂 작업 내용

  • node_modules docker volume 제거
  • node_modules를 가지고 있는 base 이미지를 base로 backend, websocket 이미지 빌드
  • nginx 컨테이너 react 정적 파일 mount에서 nginx 이미지를 빌드할 때 리액트 정적 파일 넣는 것으로 변경
  • redis 분산 락 key와 redis 데이터 key의 중복을 제거하여 redis 락을 획득하지 못 하는 이슈 해결
  • react 정적 파일을 nginx에 복사할 때 디렉토리 이름 잘못 작성한 것 수정

node_modules를 가진 이미지를 기반으로 backend, websocket 이미지를 만들어서 node_modules를 공유할 수 있도록 구현했습니다.

이미지 용량 2G 줄였습니다 .(4.5G -> 2.5G)

문서화

https://github.com/boostcampwm-2024/refactor-web39-OctoDocs/wiki/docker-%EC%9D%B4%EB%AF%B8%EC%A7%80-%EC%B5%9C%EC%A0%81%ED%99%94
https://github.com/boostcampwm-2024/refactor-web39-OctoDocs/wiki/docker-%EB%B0%B0%ED%8F%AC-%ED%99%98%EA%B2%BD-%EC%B5%9C%EC%A0%81%ED%99%94

- node_modules를 가지고 있는 docker volume 모두 제거
- root와 각 workspace별 node_modules를 가진 이미지 생성
- 위에서 만든 이미지를 기반으로 container 여러 개 생성
- redis에 page content 변경 사항을 저장하는 key와 분산 락을 저장하는
  key가 중복 발생
- key를 다르게 변경
- 빌드 스테이지에서 빌드 진행
- 프로덕션 스테이지에서 node_modules 가지고 있는 이미지를 base로 사용
- backend, websocket 빌드 스테이지 기반 이미지 octodocs-modules로 변경
- 로컬 nginx 환경 conf.d 디렉토리 마운트에서 conf.d/default.conf
  마운트로 변경
@ezcolin2 ezcolin2 linked an issue Jan 14, 2025 that may be closed by this pull request
2 tasks
@ezcolin2 ezcolin2 changed the title Refactor be #25 node_modules를 가진 base 이미지로 서버 이미지 빌드 Jan 14, 2025
Copy link
Collaborator

@summersummerwhy summersummerwhy left a comment

Choose a reason for hiding this comment

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

LGTM

@summersummerwhy summersummerwhy merged commit a3c2097 into develop Jan 15, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker 환경 개선

2 participants