Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

squedwards
Copy link

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

Copy link
Member

@bencomp bencomp left a 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
Comment on lines 6 to 12
# 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 link
Member

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 :)

Suggested change
# 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.

Comment on lines +14 to +17
# 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
Copy link
Member

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

Copy link
Member

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.

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