Skip to content

Commit e3a40e5

Browse files
fix: Address code review feedback and finalize template
This commit resolves the issues identified during the code review to finalize the Python package template. Key fixes include: - **Dockerfile Improvement:** The runtime stage of the `Dockerfile` now adds the non-root user's local bin directory to the `PATH` environment variable. This ensures that any command-line scripts installed by dependencies are directly accessible, preventing potential runtime errors. - **CI Optimization:** The redundant `lint-docker` job has been removed from the `ci.yml` workflow. Dockerfile linting is already handled comprehensively by the `hadolint` hook within the main `lint` job's `pre-commit` execution, making the separate job unnecessary and streamlining the CI process.
1 parent c682925 commit e3a40e5

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,8 @@ jobs:
3838
- name: Run pre-commit
3939
run: pre-commit run --all-files
4040

41-
lint-docker:
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
45-
- name: Lint Dockerfile
46-
uses: hadolint/hadolint-action@54c9adbab1582136bcea3692aa25b7a70191834f
47-
with:
48-
dockerfile: Dockerfile
49-
5041
test:
51-
needs: [lint, lint-docker]
42+
needs: lint
5243
runs-on: ubuntu-latest
5344
strategy:
5445
matrix:

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ FROM python:3.12-slim AS runtime
1818
RUN useradd --create-home --shell /bin/bash appuser
1919
USER appuser
2020

21+
# Add user's local bin to PATH
22+
ENV PATH="/home/appuser/.local/bin:${PATH}"
23+
2124
# Set the working directory
2225
WORKDIR /home/appuser/app
2326

0 commit comments

Comments
 (0)