Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker entrypoint script #18

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ RUN pip install --no-cache-dir -r /kiwi/requirements.txt
COPY . /kiwi
WORKDIR /kiwi

# Set the user to 'nobody' for security
USER nobody
# Create non-root user for security
RUN useradd -s /bin/bash streamlituser

# Healthcheck to ensure the app is running
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1

# Run the Streamlit app
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
ENTRYPOINT ["./entrypoint.sh"]
9 changes: 9 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -e

# Keep package yt-dlp updated on container start up
pip install --upgrade --no-cache-dir yt-dlp

# Run with streamlit user for security
runuser -u streamlituser -- streamlit run app.py --server.port=8501 --server.address=0.0.0.0 "$@"