File size: 828 Bytes
fc49018
 
e8755dc
 
 
ad1095f
 
e8755dc
 
ad1095f
e8755dc
fc49018
ad1095f
 
e8755dc
ad1095f
 
 
fc49018
54e7cc7
 
ad1095f
 
 
e8755dc
 
 
ad1095f
e8755dc
ad1095f
fc49018
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
# Use Python 3.9.11 slim as base
FROM python:3.9.11-slim

WORKDIR /app

# Install only what you need for build/runtime
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    git \
 && rm -rf /var/lib/apt/lists/*

# Copy all sources at repo root into image
COPY requirements.txt ./requirements.txt
COPY . .

# Put project root on PYTHONPATH
ENV PYTHONPATH=/app

# Install python dependencies
RUN python -m pip install --upgrade pip setuptools wheel \
 && pip install --no-cache-dir -r requirements.txt

# Spaces sets $PORT; default locally to 8501
ENV PORT=8501

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:${PORT}/_stcore/health || exit 1

# Use sh so $PORT expands at runtime
ENTRYPOINT ["/bin/sh", "-c", "streamlit run streamlit_app.py --server.port ${PORT} --server.address 0.0.0.0"]