Resume Matcher is an open source, free tool to improve your resume. It works by using language models to compare and rank resumes with job descriptions.
Fix docker image WORKDIR to avoid path not found error
Related Issue
Description
Using current WORKDIR /data in the build.dockerfile would result in cwd not found error when running get_similarity_score.py.
The error message is as followed:
resume-matcher-resume-matcher-1 | 2023-08-31 09:13:00.039 Uncaught app exception
resume-matcher-resume-matcher-1 | Traceback (most recent call last):
resume-matcher-resume-matcher-1 | File "/usr/local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
resume-matcher-resume-matcher-1 | exec(code, module.__dict__)
resume-matcher-resume-matcher-1 | File "/data/streamlit_app.py", line 15, in <module>
resume-matcher-resume-matcher-1 | from scripts.similarity.get_similarity_score import get_similarity_score, find_path, read_config
resume-matcher-resume-matcher-1 | File "/data/scripts/similarity/get_similarity_score.py", line 46, in <module>
resume-matcher-resume-matcher-1 | cwd = find_path('Resume-Matcher')
resume-matcher-resume-matcher-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
resume-matcher-resume-matcher-1 | File "/data/scripts/similarity/get_similarity_score.py", line 43, in find_path
resume-matcher-resume-matcher-1 | raise ValueError(f"Folder '{folder_name}' not found.")
resume-matcher-resume-matcher-1 | ValueError: Folder 'Resume-Matcher' not found.
This is because the pwd is at /data and there is no folder named Resume-Matcher. Once the find_path() moves up to the parent path and detected a /, it would exit and throw a "Folder not found" error.
Type
[X] Bug Fix
[ ] Feature Enhancement
[ ] Documentation Update
[ ] Code Refactoring
[ ] Other (please specify):
Proposed Changes
Modify WORKDIR in build.dockerfile as WORKDIR /data/Resume-Matcher. This make the find_path() finds the repo folder as cwd.
Screenshots / Code Snippets (if applicable)
FROM python:3.11.0-slim
WORKDIR /data/Resume-Matcher
COPY . .
RUN apt-get update
RUN apt-get install -y build-essential python-dev git
RUN pip install -U pip setuptools wheel
RUN pip install -r requirements.txt
RUN python run_first.py
ENTRYPOINT [ "streamlit", "run", "streamlit_app.py"]
EXPOSE 8501
How to Test
Run docker-compose up.
Open browser to access streamlit app.
Keywords and similarity scores are shown up.
Checklist
[ ] The code compiles successfully without any errors or warnings
[X] The changes have been tested and verified
[ ] The documentation has been updated (if applicable)
[ ] The changes follow the project's coding guidelines and best practices
[X] The commit messages are descriptive and follow the project's guidelines
[ ] All tests (if applicable) pass successfully
[ ] This pull request has been linked to the related issue (if applicable)
Pull Request Title
Fix docker image WORKDIR to avoid path not found error
Related Issue
Description
Using current
WORKDIR /data
in thebuild.dockerfile
would result in cwd not found error when runningget_similarity_score.py
.The error message is as followed:
This is because the pwd is at
/data
and there is no folder namedResume-Matcher
. Once the find_path() moves up to the parent path and detected a/
, it would exit and throw a "Folder not found" error.Type
Proposed Changes
WORKDIR
inbuild.dockerfile
asWORKDIR /data/Resume-Matcher
. This make thefind_path()
finds the repo folder as cwd.Screenshots / Code Snippets (if applicable)
How to Test
docker-compose up
.Checklist
Additional Information