-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(docker): add Dockerfile and container image build tests (#362)
* build(docker): add Dockerfile and tests This change adds a Dockerfile for pycytominer along with associated checks and tests to ensure the image is prepared for use on distribution platforms like Docker Hub. * exclude docs from dockerfile deps install Co-Authored-By: Ken Brewer <[email protected]> * build(docker): refine docker image and build tests * build(docker): refine docker build tests Co-Authored-By: Ken Brewer <[email protected]> --------- Co-authored-by: Ken Brewer <[email protected]>
- Loading branch information
1 parent
2cd5ad5
commit 9dd98ac
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM python:3.11 as base | ||
|
||
# set various metadata, loosely following biocontainers standards from: | ||
# https://biocontainers-edu.readthedocs.io/en/latest/what_is_biocontainers.html | ||
LABEL base_image="python:3.11" | ||
LABEL software="pycytominer" | ||
LABEL about.summary="Python package for processing image-based profiling data" | ||
LABEL about.home="https://github.com/cytomining/pycytominer" | ||
LABEL about.documentation="https://pycytominer.readthedocs.io/en/stable/" | ||
LABEL about.license_file="https://github.com/cytomining/pycytominer/blob/main/LICENSE.md" | ||
LABEL about.license="SPDX:BSD-3-Clause" | ||
|
||
# set the workdir to /app | ||
WORKDIR /app | ||
|
||
# configures poetry to install dependencies without virtualenvs | ||
# see: https://python-poetry.org/docs/configuration/#virtualenvscreate | ||
ENV POETRY_VIRTUALENVS_CREATE=false | ||
|
||
# install poetry and poetry dynamic versioning | ||
# hadolint ignore=DL3013 | ||
RUN pip install --no-cache-dir poetry | ||
|
||
# create stage for production build (no dev or non-essential deps) | ||
FROM base as production | ||
|
||
# copy the pycytominer source into image | ||
COPY . . | ||
|
||
# install pycytominer using poetry root dependencies and all extras | ||
RUN poetry install --all-extras -v --no-interaction | ||
|
||
# create stage for production build (no dev or non-essential deps) | ||
FROM production as testing | ||
|
||
# install pycytominer from poetry with group deps and all extras for testing | ||
RUN poetry install --with dev --all-extras -v --no-interaction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters