Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions Dockerfiles/murfey-instrument-server
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
FROM docker.io/library/python:3.12-slim-bookworm AS base

# Install Vim in base image
RUN apt-get update && \
RUN \
echo "Setting up base image..." && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
rsync \
Expand All @@ -17,8 +19,11 @@ RUN apt-get update && \

# Build Murfey in a branch image
FROM base as build
COPY ./ /python-murfey/
RUN apt-get update && \

RUN \
--mount=type=bind,source=.,target=/mnt/python-murfey,U \
echo "Installing build dependencies..." && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
Expand All @@ -27,12 +32,14 @@ RUN apt-get update && \
libpq-dev \
&& \
busybox --install && \
echo "Installing Murfey..." && \
cp -r /mnt/python-murfey /tmp/python-murfey && \
python -m venv /venv && \
/venv/bin/python -m pip install --upgrade \
pip \
build \
importlib-metadata && \
/venv/bin/python -m pip install /python-murfey[sxt]
/venv/bin/python -m pip install /tmp/python-murfey[sxt]


# Transfer completed Murfey build to base image
Expand All @@ -44,10 +51,10 @@ ARG groupname
ARG userid

# Copy completed Murfey build across and set user and group permissions
COPY --from=build /venv/ /venv/
RUN groupadd -r -g "${groupid}" "${groupname}" && \
COPY --from=build --chown="${userid}":"${groupid}" /venv/ /venv/
RUN \
groupadd -r -g "${groupid}" "${groupname}" && \
useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}" && \
chown -R "${userid}":"${groupid}" /venv && \
chmod -R a+x /venv
ENV PATH=/venv/bin:$PATH
USER "${userid}":"${groupid}"
52 changes: 28 additions & 24 deletions Dockerfiles/murfey-server
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,52 @@
FROM docker.io/library/python:3.12-slim-bookworm AS base

# Install Vim and PostgreSQL dependencies in base image
RUN apt-get update && \
RUN \
echo "Setting up base image..." && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
libpq-dev \
vim \
&& \
vim && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*


# 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 && \
RUN \
--mount=type=bind,source=.,target=/mnt/python-murfey,U \
echo "Installing build dependencies..." && \
apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
busybox \
curl \
net-tools \
&& \
net-tools && \
busybox --install && \
echo "Installing Murfey..." && \
cp -r /mnt/python-murfey /tmp/python-murfey && \
python -m venv /venv && \
/venv/bin/python -m pip install --upgrade \
pip \
build \
importlib-metadata \
psycopg2-binary \
&& \
/venv/bin/python -m pip install /python-murfey[server] && \
if [ ! -f /python-murfey/installers/${IMOD_INSTALLER} ]; then \
psycopg2-binary && \
/venv/bin/python -m pip install /tmp/python-murfey[server] && \
echo "Installing IMOD..." && \
mkdir /imod && \
if [ -f /mnt/python-murfey/installers/${IMOD_INSTALLER} ]; then \
bash "/mnt/python-murfey/installers/${IMOD_INSTALLER}" -dir /imod -skip -y; \
else \
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 && \
/python-murfey/installers/${IMOD_INSTALLER} -dir imod -skip -y

curl -L \
-o "/tmp/${IMOD_INSTALLER}" \
https://bio3d.colorado.edu/imod/AMD64-RHEL5/${IMOD_INSTALLER}; \
bash "/tmp/${IMOD_INSTALLER}" -dir /imod -skip -y; \
fi

# Transfer completed builds to base image
FROM base
Expand All @@ -57,12 +61,12 @@ ARG groupname
ARG userid

# Copy completed Murfey and IMOD builds across and set user and group permissions
COPY --from=build /venv/ /venv/
COPY --from=build /imod/ /imod/
RUN groupadd -r -g "${groupid}" "${groupname}" && \
COPY --from=build --chown="${userid}":"${groupid}" /venv/ /venv/
COPY --from=build --chown="${userid}":"${groupid}" /imod/ /imod/
RUN \
groupadd -r -g "${groupid}" "${groupname}" && \
useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}" && \
chown -R "${userid}":"${groupid}" /venv && \
chmod -R a+x /venv
chmod -R a+x /venv /imod
ENV PATH=/venv/bin:/imod/IMOD/bin:$PATH
ENV IMOD_DIR=/imod/IMOD
USER "${userid}":"${groupid}"