-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 886 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (25 loc) · 886 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 a slim, modern Python base image
FROM python:3.13.5-slim
# Set the working directory inside the container
WORKDIR /app
# Install system dependencies (for compiling some Python packages)
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better layer caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the project files
COPY . .
# Expose Streamlit default port
EXPOSE 8501
# Health check for Cloud Run
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
# Set Streamlit environment variables
ENV STREAMLIT_THEME_BASE=light \
PYTHONUNBUFFERED=1
# Run the Streamlit app
ENTRYPOINT ["streamlit", "run", "app/main.py", "--server.port=8501", "--server.address=0.0.0.0"]