File size: 1,029 Bytes
fef55f9
effc62f
 
 
fef55f9
 
 
effc62f
3d072c5
a5f67d6
fef55f9
 
effc62f
fef55f9
 
 
effc62f
fef55f9
 
effc62f
fef55f9
 
e67b323
01e5f06
fef55f9
 
 
 
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
# Dockerfile
FROM python:3.10-slim

WORKDIR /app
# tells the system to treat /app as the "home" directory, so Streamlit will create /app/.streamlit instead of /.streamlit.
# /app is already writable as root, so no permission issues.
ENV HOME=/app



# (Optional) system deps if you need them; safe to remove if not needed
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*

# Install Python deps
COPY requirements.txt /app/
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

# Copy code
COPY . /app

# Do NOT set STREAMLIT_SERVER_PORT here.
# Spaces will inject $PORT at runtime.


# Start Streamlit on the port Spaces provides, and bind to 0.0.0.0
# CMD ["bash", "-lc", "streamlit run /app/frontend.py --server.port $PORT --server.address 0.0.0.0"]
# CMD ["sh", "-c", "streamlit run /app/frontend.py --server.port $PORT --server.address 0.0.0.0"]
CMD ["streamlit", "run", "/app/frontend.py", "--server.port", "8501", "--server.address", "0.0.0.0"]