You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1012 B
36 lines
1012 B
FROM python:3.13-slim
|
|
|
|
# Install minimal system deps
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends build-essential curl ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create non-root user for running the app
|
|
RUN useradd -m -s /bin/bash app
|
|
|
|
WORKDIR /home/app/app
|
|
|
|
# Copy project files
|
|
COPY . /home/app/app
|
|
|
|
# Upgrade pip and install either pinned requirements or runtime defaults
|
|
RUN python -m pip install --upgrade pip
|
|
RUN if [ -f requirements.txt ]; then \
|
|
pip install -r requirements.txt; \
|
|
else \
|
|
pip install uv streamlit duckdb; \
|
|
fi
|
|
|
|
# Fix permissions
|
|
RUN chown -R app:app /home/app
|
|
|
|
USER app
|
|
ENV PYTHONPATH=/home/app/app
|
|
|
|
EXPOSE 8501
|
|
|
|
# Simple healthcheck that queries the Streamlit root
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s CMD curl -f http://localhost:8501/ || exit 1
|
|
|
|
# Run the Streamlit app via uv as preferred in this project
|
|
CMD ["uv", "run", "streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|