Docker image hardened, seems to be working stable
This commit is contained in:
@@ -3,3 +3,4 @@ build/
|
||||
dist/
|
||||
*.egg-info/
|
||||
*.pyc
|
||||
test_data/
|
||||
+10
-4
@@ -1,8 +1,14 @@
|
||||
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 && \
|
||||
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 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
@@ -47,5 +53,5 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
# Set the entrypoint
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
|
||||
# Default command (shows help if no arguments)
|
||||
CMD ["audio_splitter", "--help"]
|
||||
# Default command (shows help if no arguments provided)
|
||||
CMD ["--help"]
|
||||
@@ -9,9 +9,10 @@ if [ "$(id -u)" = "0" ]; then
|
||||
chown -R appuser:appgroup /data
|
||||
fi
|
||||
|
||||
# Drop privileges and run the command using gosu
|
||||
exec gosu appuser "$@"
|
||||
# Drop privileges and run audio_splitter with the provided arguments
|
||||
exec gosu appuser audio_splitter "$@"
|
||||
else
|
||||
# If not root, just run the command directly
|
||||
exec "$@"
|
||||
# If not root, just run audio_splitter directly
|
||||
# It's not supposed to be called
|
||||
exec audio_splitter "$@"
|
||||
fi
|
||||
Reference in New Issue
Block a user