-
Notifications
You must be signed in to change notification settings - Fork 1
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
Containerise, add dockerfile and job to push to dockerhub #5
base: main
Are you sure you want to change the base?
Containerise, add dockerfile and job to push to dockerhub #5
Conversation
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.
We don't need to install git and clone the repo. The other comments are discussion points.
Containerfile
Outdated
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Clone the repository | ||
RUN git clone https://github.com/LeidenUniversityLibrary/abnormal-hieratic-indexer.git /app |
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.
The code is in this repository, so we don't need to clone from GitHub :)
# Install system dependencies | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
git \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Clone the repository | |
RUN git clone https://github.com/LeidenUniversityLibrary/abnormal-hieratic-indexer.git /app | |
COPY . /app |
Instead of copying everything (including .github
), we could be more selective in the COPY
command, or include .dockerignore
.
# Install dependencies based on pyproject.toml | ||
RUN pip install --upgrade pip && pip install build | ||
RUN python -m build | ||
RUN pip install dist/*.whl # or dist/*.tar.gz if it generates a source distribution |
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.
We also build and publish the package on PyPI in a different workflow, so we could pip install abnormal-hieratic-indexer
. That workflow does only run when a release is published, so it may not be what we want.
RUN pip install --upgrade pip && pip install build | ||
RUN python -m build | ||
RUN pip install dist/*.whl # or dist/*.tar.gz if it generates a source distribution | ||
|
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.
It would be nice to have an ENTRYPOINT
or CMD
(or both?), to show what we intend the image to be used for. It would also allow for a shorter docker run
command.
It's always nice to have it containerised.
Also the python version/dependencies required does not seem to work easily on the host server, we can decouple those requirements by containerisation