Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
python3-venv를 추가하신 것은 좋은 결정입니다. 하지만 현재 Dockerfile에서는 가상 환경이 사용되지 않고 있어, 패키지들이 전역으로 설치되고 있습니다. 가상 환경을 사용하면 의존성을 격리하여 더 안정적이고 예측 가능한 환경을 구축할 수 있습니다.
또한, Docker 이미지 빌드 캐시를 더 효율적으로 사용하기 위해
requirements.txt파일을 먼저 복사하여 의존성을 설치하고, 그 다음에 나머지 소스 코드를 복사하는 것이 좋습니다. 이렇게 하면 소스 코드만 변경되었을 때 매번 의존성을 다시 설치하는 것을 피할 수 있습니다.이 두 가지 개선 사항을 적용하여 Dockerfile을 다음과 같이 리팩토링하는 것을 제안합니다:
이 리팩토링을 적용하면
ln -s /usr/bin/python3 /usr/bin/python명령어는 더 이상 필요하지 않습니다.ENV PATH설정을 통해python과pip명령어는 자동으로 가상 환경 내의 버전을 사용하게 되기 때문입니다.