mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-30 22:14:37 +00:00
Actor: Update Docker configuration for improved security
- Add `ACTOR_PATH_IN_DOCKER_CONTEXT` argument to ignore the Apify-tooling related warning. - Improve readability with consistent formatting and spacing in RUN commands. - Enhance security by properly setting up appuser home directory and permissions. - Streamline directory structure and ownership for runtime operations. - Remove redundant `.apify` directory creation as it's handled by the CLI. Signed-off-by: Václav Vančura <commit@vancura.dev>
This commit is contained in:
parent
b2ac6cc218
commit
dde401d134
@ -1,3 +1,5 @@
|
||||
ARG ACTOR_PATH_IN_DOCKER_CONTEXT
|
||||
|
||||
FROM python:3.11-slim-bookworm
|
||||
|
||||
LABEL maintainer="Vaclav Vancura <@vancura>"
|
||||
@ -7,23 +9,30 @@ LABEL version="1.0.0"
|
||||
RUN groupadd -r appuser && useradd -r -g appuser -s /sbin/nologin appuser && \
|
||||
\
|
||||
apt-get update && apt-get install -y --no-install-recommends bash curl file git gpg jo jq procps xz-utils && \
|
||||
\
|
||||
mkdir -p /etc/apt/keyrings && \
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
|
||||
\
|
||||
apt-get update && apt-get install -y nodejs && apt-get clean && \
|
||||
\
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
\
|
||||
pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir docling==2.15.1 && \
|
||||
\
|
||||
npm install -g npm@latest && \
|
||||
npm install -g apify-cli && \
|
||||
npm cache clean --force
|
||||
npm cache clean --force && \
|
||||
\
|
||||
mkdir -p /home/appuser && \
|
||||
chown -R appuser:appuser /home/appuser
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN mkdir -p /tmp/runtime-root /home/appuser/.apify && \
|
||||
RUN mkdir -p /tmp/runtime-root && \
|
||||
chmod 0700 /tmp/runtime-root && \
|
||||
chown -R appuser:appuser /tmp/runtime-root /home/appuser/.apify
|
||||
chown -R appuser:appuser /tmp/runtime-root /app
|
||||
|
||||
COPY --chown=appuser:appuser .actor/ .actor/
|
||||
COPY --chown=appuser:appuser . .
|
||||
|
Loading…
Reference in New Issue
Block a user