Skip to content

Commit b1db502

Browse files
committed
fix(ci/security): implement read-only docker files and secure action SHAs
1 parent 07c0270 commit b1db502

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ jobs:
2525
--health-retries 5
2626
2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@34e1148c96885b84ce963966bbcc8dd0ffba2907
2929

3030
- name: Install uv
31-
uses: astral-sh/setup-uv@v5
31+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b
32+
with:
33+
enable-cache: true
3234

3335
- name: Set up Python 3.12
34-
uses: actions/setup-python@v5
36+
uses: actions/setup-python@a26af6904029667666629302957144f8f4090488
3537
with:
3638
python-version: "3.12"
3739

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ FROM python:3.12-slim-bookworm
1212

1313
WORKDIR /app
1414

15-
RUN useradd -m -u 1000 appuser && \
16-
chown appuser:appuser /app
15+
RUN useradd -m -u 1000 appuser
1716

18-
COPY --from=builder --chown=appuser:appuser --chmod=555 /app/.venv /app/.venv
17+
COPY --from=builder --chmod=555 /app/.venv /app/.venv
1918

2019
ENV PATH="/app/.venv/bin:$PATH"
2120

22-
COPY --chown=appuser:appuser --chmod=555 src/ ./src/
23-
COPY --chown=appuser:appuser --chmod=555 migrations/ ./migrations/
24-
COPY --chown=appuser:appuser --chmod=555 alembic.ini pyproject.toml uv.lock ./
25-
COPY --chown=appuser:appuser --chmod=555 scripts/ ./scripts/
21+
COPY --chmod=555 src/ ./src/
22+
COPY --chmod=555 migrations/ ./migrations/
23+
COPY --chmod=555 alembic.ini pyproject.toml uv.lock ./
24+
COPY --chmod=555 scripts/ ./scripts/
2625

2726
USER appuser
2827

0 commit comments

Comments
 (0)