-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 922 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (25 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use official Python base image
FROM mcr.microsoft.com/devcontainers/base:noble
# Install uv for fast dependency management
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Set working directory
WORKDIR /app
# Copy dependency files first (for better layer caching)
COPY pyproject.toml uv.lock ./
# Install dependencies using uv (no dev dependencies)
RUN uv sync --frozen --no-dev --no-install-project
# Copy application code
COPY src/ ./src/
COPY app/ ./app/
COPY data/ ./data/
# Expose Streamlit default port
EXPOSE 8501
# Set environment variables for Streamlit
ENV STREAMLIT_SERVER_PORT=8501
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
# Health check
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
# Run the Streamlit app
WORKDIR /app/app
CMD ["uv", "run", "streamlit", "run", "titanic_app.py", "--server.port=8501", "--server.address=0.0.0.0"]