Docker image hardened, seems to be working stable

This commit is contained in:
2026-07-30 09:46:31 +00:00
parent 5b0bb25177
commit 9d30844a1e
3 changed files with 17 additions and 9 deletions
+1
View File
@@ -3,3 +3,4 @@ build/
dist/ dist/
*.egg-info/ *.egg-info/
*.pyc *.pyc
test_data/
+10 -4
View File
@@ -1,8 +1,14 @@
FROM python:3.13-slim FROM python:3.13-slim
# Install FFmpeg and dependencies (gosu will be downloaded separately) # Install FFmpeg and dependencies required for gosu installation
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg ca-certificates wget gpg && \ apt-get install -y --no-install-recommends \
ffmpeg \
ca-certificates \
wget \
gnupg \
dirmngr \
gnupg-agent && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
@@ -47,5 +53,5 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Set the entrypoint # Set the entrypoint
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# Default command (shows help if no arguments) # Default command (shows help if no arguments provided)
CMD ["audio_splitter", "--help"] CMD ["--help"]
+5 -4
View File
@@ -9,9 +9,10 @@ if [ "$(id -u)" = "0" ]; then
chown -R appuser:appgroup /data chown -R appuser:appgroup /data
fi fi
# Drop privileges and run the command using gosu # Drop privileges and run audio_splitter with the provided arguments
exec gosu appuser "$@" exec gosu appuser audio_splitter "$@"
else else
# If not root, just run the command directly # If not root, just run audio_splitter directly
exec "$@" # It's not supposed to be called
exec audio_splitter "$@"
fi fi