Skip to content

Commit 5f0b774

Browse files
committed
Further optimised build instructions to reduce size and set necessary permissions
1 parent aa472a4 commit 5f0b774

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Dockerfiles/murfey-server

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ARG userid
1212
# Add system dependencies for the developer/build environment
1313
# Add the group and user ID to be used by Murfey
1414
# Create virtual Python environment in which to install Murfey
15+
# Change properties of said Python environment
1516
RUN apt-get update && \
1617
apt-get upgrade -y && \
1718
apt-get install -y --no-install-recommends \
@@ -20,23 +21,26 @@ RUN apt-get update && \
2021
git \
2122
net-tools \
2223
libpq-dev && \
23-
busybox --install &&\
24+
busybox --install && \
2425
rm -rf /var/lib/apt/lists/* && \
2526
groupadd -r -g "${groupid}" "${groupname}" && \
2627
useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}" && \
2728
python -m venv /venv && \
29+
chown -R "${userid}":"${groupid}" /venv && \
2830
chmod -R a+x /venv
2931
ENV PATH=/venv/bin:$PATH
3032

3133
# Build Murfey in a different image
34+
# Change properties of the built Python environment
3235
FROM base AS build
3336
COPY --chown="${userid}":"${groupid}" ./ /python-murfey/
3437
RUN python -m pip install --upgrade \
3538
pip \
3639
build \
3740
importlib-metadata \
3841
psycopg2-binary && \
39-
python -m pip install /python-murfey[server]
42+
python -m pip install /python-murfey[server] && \
43+
chmod -R a+x /venv
4044

4145
# Copy installed files across to final image
4246
FROM base

0 commit comments

Comments
 (0)