Skip to content

Commit d6e0868

Browse files
committed
fix(dockerfile): update cache directory path and ownership for non-root user
- Change cache directory from /app/cache to /home/app/.cache/crawler-to-md - Ensure directory is owned by the app user and update VOLUME accordingly - Create home directory for app user with -m flag
1 parent 50eb59d commit d6e0868

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
1313

1414
# Create a non-root user and group for enhanced security
1515
RUN groupadd --system --gid 1001 app && \
16-
useradd --system --uid 1001 --gid 1001 app
16+
useradd --system --uid 1001 --gid 1001 -m app
1717

1818
# ==============================================================================
1919
# Builder Stage: Install system and Python dependencies with optimized caching
@@ -74,11 +74,11 @@ RUN --mount=type=cache,target=/var/cache/apt,id=apt-cache-${TARGETPLATFORM} \
7474
COPY --from=builder --chown=app:app /app /app
7575

7676
# This must be done as root BEFORE switching to the non-root user
77-
RUN mkdir -p /app/cache && chown -R app:app /app/cache
77+
RUN mkdir -p /home/app/.cache/crawler-to-md && chown -R app:app /home/app/.cache/crawler-to-md
7878

7979
# Switch to the non-root user for execution
8080
USER app
8181

82-
VOLUME [ "/app/cache" ]
82+
VOLUME [ "/home/app/.cache/crawler-to-md" ]
8383

8484
ENTRYPOINT [ "/app/.venv/bin/crawler-to-md" ]

0 commit comments

Comments
 (0)