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

Update container image to address vulnerabilities #1000

Merged
Merged
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
24 changes: 17 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
ca-certificates \
python3 \
python3-numpy \
python3-pip \
python3-pymysql \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& python3 -m pip install --upgrade --no-cache-dir pip wheel setuptools \
&& python3 -m pip install --no-cache-dir \
numpy \
pymysql

# Set Environment
ENV APP_FOLDER=/usr/app
Expand Down Expand Up @@ -70,9 +72,17 @@ RUN mkdir -p ${SETTINGS_DIR} \
&& chown node:node ${APP_BUNDLE_FOLDER}/bundle/programs/server/fileCache \
&& chmod 644 ${APP_BUNDLE_FOLDER}/bundle/programs/server/fileCache

# Install the Meteor app's NPM dependencies and update the OS in the container
RUN bash $SCRIPTS_FOLDER/build-meteor-npm-dependencies.sh
RUN apt-get update && apt-get -y upgrade && apt-get clean && apt-get clean && rm -rf /var/lib/apt/lists/*
# Install the Meteor app's NPM dependencies
# g++ & build-essential are needed for Apple Silicon builds
RUN apt-get update && apt-get install -y --no-install-recommends g++ build-essential \
&& bash $SCRIPTS_FOLDER/build-meteor-npm-dependencies.sh \
&& apt-get purge -y g++ build-essential \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

# Update the OS packages in the container
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

EXPOSE ${PORT}
USER node
Expand All @@ -89,7 +99,7 @@ LABEL version=${BUILDVER} code.branch=${COMMITBRANCH} code.commit=${COMMITSHA}


# Create a stage with the root user for debugging
# Note - you'll need to override the entrypoint if you want a shell (docker run --entrypoint /bin/bash ...)
# Note - you'll need to override the entrypoint if you want a shell (docker run -it --entrypoint /bin/bash ...)
FROM production AS debug
USER root

Expand Down