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

add: sonarcube suggestions on disable package install recommends #6087

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ FROM runtime as prod
USER root
# Get the necessary bits for the health check
RUN apt-get update && \
apt-get install -y curl && \
apt-get install --no-install-recommends -y curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Pre-compile packages to .pyc (init speed gains)
Expand Down
13 changes: 6 additions & 7 deletions scripts/docker/tasking-manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@ FROM python:${PYTHON_IMG_TAG}-bookworm
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

ENV PATH="/usr/src/app/__pypackages__/${PYTHON_IMG_TAG}/bin:$PATH" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this being removed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eternaltyro python stuff are inherited from python:3.10-bookworm base image. idk why PATH and PYTHONPATH are updated to use /usr/src/app/__pypackages__/${PYTHON_IMG_TAG}/bin where nothing exists.
It was also flagged by sonarcube. these changes are non destructive.

PYTHONPATH="/usr/src/app/__pypackages__/${PYTHON_IMG_TAG}/lib"

# INSTALLATION

# Add repository for node
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -

# Install dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y nodejs libgeos-dev \
&& apt-get install -y --no-install-recommends nodejs libgeos-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Upgrade pip
Expand All @@ -26,6 +21,10 @@ ARG branch=develop
RUN git clone --depth=1 git://github.com/hotosm/tasking-manager.git \
--branch $branch /usr/src/app

## Create & use new user to run pdm
RUN useradd --uid 9000 --create-home --home /home/appuser --shell /bin/false appuser
USER appuser:appuser

## SETUP

# Setup backend dependencies
Expand All @@ -35,7 +34,7 @@ RUN pip install --no-cache-dir pdm \
&& pdm install --prod --no-lock --no-editable

# Setup and build frontend
RUN cd frontend && npm install && npm run build
RUN cd frontend && npm install --ignore-scripts && npm run build
eternaltyro marked this conversation as resolved.
Show resolved Hide resolved

# INITIALIZATION

Expand Down
Loading