Skip to content
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
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repos:
- id: detect-secrets

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.7.3
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -59,6 +59,11 @@ repos:
additional_dependencies: [types-requests, types-PyYAML]

- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 39.0.0
rev: 39.8.0
hooks:
- id: renovate-config-validator

- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ EXPOSE 5000
ENV USERNAME="podman"
ENV HOME_DIR="/home/$USERNAME"
ENV BIN_DIR="$HOME_DIR/.local/bin"
ENV UV_INSTALL_DIR="$HOME_DIR/.local"
ENV PATH="$PATH:$BIN_DIR"
ENV DATA_DIR="$HOME_DIR/data"
ENV APP_DIR="$HOME_DIR/github-webhook-server"
Expand Down Expand Up @@ -36,10 +35,7 @@ RUN usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $USERNAME \
USER $USERNAME
WORKDIR $HOME_DIR

# Download the latest uv installer
RUN curl -sSL https://astral.sh/uv/install.sh -o /tmp/uv-installer.sh \
&& sh /tmp/uv-installer.sh \
&& rm /tmp/uv-installer.sh
RUN python3 -m pip install uv
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance the uv installation command with best practices.

The pip installation command should follow Docker best practices:

  1. Pin the package version for reproducible builds
  2. Use --no-cache-dir to reduce image size
  3. Use --user flag when installing as non-root user

Apply this diff:

-RUN python3 -m pip install uv
+RUN python3 -m pip install --no-cache-dir --user uv==0.1.13
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN python3 -m pip install uv
RUN python3 -m pip install --no-cache-dir --user uv==0.1.13


RUN set -x \
&& curl https://mirror.openshift.com/pub/openshift-v4/clients/rosa/latest/rosa-linux.tar.gz --output $BIN_DIR/rosa-linux.tar.gz \
Expand Down
Loading