diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..223f7f8d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +# Ignore everything by default +** + +# Whitelist only the files and folders needed for building +!Dockerfiles/ +!installers/ +!src/ +!pyproject.toml +!setup.py +!LICENSE +!MANIFEST.in +!README.md diff --git a/.gitignore b/.gitignore index 2dae531e..b15c8943 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,6 @@ ENV/ # mypy .mypy_cache/ + +# ruff +.ruff_cache/ diff --git a/Dockerfiles/murfey-server b/Dockerfiles/murfey-server index 3418124e..b44a1b6d 100644 --- a/Dockerfiles/murfey-server +++ b/Dockerfiles/murfey-server @@ -17,6 +17,10 @@ RUN apt-get update && \ # Build Murfey and IMOD in a branch image FROM base as build + +# Set up build argumentss for this stage +ARG IMOD_INSTALLER=imod_5.1.9_RHEL8-64_CUDA12.0.sh + COPY ./ /python-murfey/ RUN apt-get update && \ apt-get upgrade -y && \ @@ -35,10 +39,13 @@ RUN apt-get update && \ psycopg2-binary \ && \ /venv/bin/python -m pip install /python-murfey[server] && \ - curl https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_5.1.9_RHEL8-64_CUDA12.0.sh > imod_5.1.9_RHEL8-64_CUDA12.0.sh && \ - chmod +x imod_5.1.9_RHEL8-64_CUDA12.0.sh && \ + if [ ! -f /python-murfey/installers/${IMOD_INSTALLER} ]; then \ + echo "IMOD installer not found; downloading..."; \ + curl https://bio3d.colorado.edu/imod/AMD64-RHEL5/${IMOD_INSTALLER} > /python-murfey/installers/${IMOD_INSTALLER}; \ + fi && \ + chmod +x /python-murfey/installers/${IMOD_INSTALLER} && \ mkdir imod && \ - ./imod_5.1.9_RHEL8-64_CUDA12.0.sh -dir imod -skip -y + /python-murfey/installers/${IMOD_INSTALLER} -dir imod -skip -y # Transfer completed builds to base image diff --git a/installers/README.md b/installers/README.md new file mode 100644 index 00000000..c0cfeab6 --- /dev/null +++ b/installers/README.md @@ -0,0 +1,2 @@ +This is placeholder folder in which installation files for the Docker containers can be placed. +The Dockerfiles will first check to see if the desired file is located here before attempting to download it.