-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 791 Bytes
/
Dockerfile
File metadata and controls
30 lines (24 loc) · 791 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
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
TF_CPP_MIN_LOG_LEVEL=2
# System deps for scientific Python (build + fonts for matplotlib)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
ca-certificates \
fonts-dejavu-core \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt /app/
RUN python -m pip install --upgrade pip && pip install -r requirements.txt
# Copy app source last for better caching
COPY . /app
# Security: run as non-root
RUN useradd -m appuser && chown -R appuser /app
USER appuser
# Cloud Run listens on $PORT
EXPOSE 8080
CMD ["/bin/sh", "-c", "streamlit run app.py --server.port=${PORT:-8080} --server.address=0.0.0.0"]