Actor: Enhance Docker security with proper user permissions

- 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>
This commit is contained in:
Václav Vančura 2025-01-22 12:01:57 +01:00 committed by Adam Kliment
parent ae491b0516
commit 19f612c009

View File

@ -14,9 +14,13 @@ RUN npm install -g apify-cli && npm cache clean --force
WORKDIR /app
RUN mkdir -p /tmp/runtime-root && chmod 0700 /tmp/runtime-root
RUN mkdir -p /tmp/runtime-root && \
chmod 0700 /tmp/runtime-root && \
chown appuser:appuser /tmp/runtime-root
COPY .actor/ .actor/
COPY . .
COPY --chown=appuser:appuser .actor/ .actor/
COPY --chown=appuser:appuser . .
USER appuser
ENTRYPOINT [".actor/actor.sh"]