Skip to content

b/e docker 에러 수정. axios관련 빌드 산출물 복사.#59

Merged
gangjung merged 1 commit intomainfrom
feature/BEYONDWORM-87
Feb 28, 2026
Merged

b/e docker 에러 수정. axios관련 빌드 산출물 복사.#59
gangjung merged 1 commit intomainfrom
feature/BEYONDWORM-87

Conversation

@gangjung
Copy link
Copy Markdown
Collaborator

Docker Error:

Error: Cannot find module 'axios'
Require stack:

  • /app/shared/dist/cjs/utils.js
  • /app/shared/dist/cjs/index.js
  • /app/lobby-server/dist/index.js

@gangjung gangjung self-assigned this Feb 27, 2026
@notion-workspace
Copy link
Copy Markdown

백엔드 호스팅

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 game-server 및 lobby-server Docker 컨테이너에서 'axios' 모듈을 찾을 수 없어 발생하던 런타임 오류를 해결합니다. 이 문제는 shared 모듈의 의존성인 node_modules가 Docker 이미지에 제대로 포함되지 않아 발생했습니다. 해결책으로, 두 서버의 Dockerfile에 shared 모듈의 node_modules 디렉토리를 빌더 이미지에서 최종 이미지로 복사하는 단계를 추가하여 모든 필요한 의존성이 배포된 컨테이너에서 사용 가능하도록 보장했습니다.

Highlights

  • Docker 빌드 오류 수정: 'axios' 모듈을 찾을 수 없어 발생하던 Docker 런타임 오류를 해결했습니다.
  • 공유 모듈 의존성 복사: game-server 및 lobby-server Docker 이미지에 shared 모듈의 node_modules 디렉토리를 복사하도록 Dockerfile을 업데이트했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • game-server/Dockerfile
    • shared 모듈의 node_modules를 복사하는 명령을 추가했습니다.
  • lobby-server/Dockerfile
    • shared 모듈의 node_modules를 복사하는 명령을 추가했습니다.
Activity
  • 이 PR에 대한 활동은 아직 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

안녕하세요. Docker 빌드 오류를 수정하기 위한 변경 사항 잘 보았습니다. axios 모듈을 찾지 못하는 문제를 해결하기 위해 shared/node_modules를 복사하는 직관적인 해결책을 적용하셨네요.

다만 이 방법은 의존성이 중복되어 Docker 이미지 크기가 커지는 단점이 있습니다. 리뷰 코멘트를 통해 각 Dockerfile에서 NODE_PATH 환경 변수를 사용하여 의존성을 공유하는 더 효율적인 방법을 제안드렸습니다. 이 방법을 적용하면 중복을 제거하고 이미지를 더 가볍게 유지할 수 있을 것입니다. 검토 부탁드립니다.

Comment thread game-server/Dockerfile
Comment on lines +44 to 46
COPY --from=builder /app/shared/node_modules ./shared/node_modules
COPY --from=builder /app/shared/package.json ./shared/package.json
COPY --from=builder /app/shared/dist ./shared/dist
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

이 변경으로 axios 모듈을 찾지 못하는 문제는 해결되지만, game-server/node_modulesshared/node_modulesaxios가 중복으로 포함되어 이미지 크기가 불필요하게 커질 수 있습니다.

NODE_PATH 환경 변수를 설정하여 shared 모듈이 game-servernode_modules를 참조하도록 하는 것이 더 효율적인 방법입니다. 이렇게 하면 shared/node_modules를 복사할 필요가 없어지고 의존성 중복을 피할 수 있습니다.

COPY --from=builder /app/shared/package.json ./shared/package.json
COPY --from=builder /app/shared/dist ./shared/dist

# shared 모듈이 game-server의 node_modules를 찾을 수 있도록 경로 설정
ENV NODE_PATH=/app/game-server/node_modules

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

이 방법도 좋은 해결법이지만, shared에서 필요한 모듈 정보를 game-server라는 다른 곳에서 찾게되면, 그 곳에 디팬던시가 걸리게 됩니다. 나중에 game-server에서 axios를 안쓰게된다면, 다시 문제가 발생할 수 있죠. 물론 그런 일이 거의 발생하지 않을 것이긴 합니다.
기존와 추천하는 방법 모두 현재 사용가능하기에, 기존 방법을 일단 따르겠습니다.

Comment thread lobby-server/Dockerfile
Comment on lines +33 to 35
COPY --from=builder /app/shared/node_modules ./shared/node_modules
COPY --from=builder /app/shared/package.json ./shared/package.json
COPY --from=builder /app/shared/dist ./shared/dist
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

이 변경으로 axios 모듈을 찾지 못하는 문제는 해결되지만, lobby-server/node_modulesshared/node_modulesaxios가 중복으로 포함되어 이미지 크기가 불필요하게 커질 수 있습니다.

NODE_PATH 환경 변수를 설정하여 shared 모듈이 lobby-servernode_modules를 참조하도록 하는 것이 더 효율적인 방법입니다. 이렇게 하면 shared/node_modules를 복사할 필요가 없어지고 의존성 중복을 피할 수 있습니다.

COPY --from=builder /app/shared/package.json ./shared/package.json
COPY --from=builder /app/shared/dist ./shared/dist

# shared 모듈이 lobby-server의 node_modules를 찾을 수 있도록 경로 설정
ENV NODE_PATH=/app/lobby-server/node_modules

Copy link
Copy Markdown
Contributor

@konempty konempty left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 👍 👍

@gangjung gangjung merged commit 16c62af into main Feb 28, 2026
2 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.

2 participants