mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-01 15:02:21 +00:00
- Set proper ownership and permissions for runtime directory. - Switch to non-root user for enhanced security. - Use `--chown` flag in COPY commands to maintain correct file ownership. - Ensure all files and directories are owned by `appuser`. Signed-off-by: Václav Vančura <commit@vancura.dev>
27 lines
894 B
Docker
27 lines
894 B
Docker
FROM python:3.11-slim-bookworm
|
|
|
|
RUN apt-get update && apt-get install -y file procps curl gpg
|
|
|
|
RUN 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
|
|
|
|
RUN apt-get update && apt-get install -y nodejs bash git jq jo xz-utils && apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --no-cache-dir docling
|
|
|
|
RUN npm install -g apify-cli && npm cache clean --force
|
|
|
|
WORKDIR /app
|
|
|
|
RUN mkdir -p /tmp/runtime-root && \
|
|
chmod 0700 /tmp/runtime-root && \
|
|
chown appuser:appuser /tmp/runtime-root
|
|
|
|
COPY --chown=appuser:appuser .actor/ .actor/
|
|
COPY --chown=appuser:appuser . .
|
|
|
|
USER appuser
|
|
|
|
ENTRYPOINT [".actor/actor.sh"]
|