omgy commited on
Commit
db09025
·
verified ·
1 Parent(s): e71783b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1 \
5
+ PIP_NO_CACHE_DIR=1 \
6
+ STREAMLIT_SERVER_HEADLESS=true \
7
+ STREAMLIT_BROWSER_GATHERUSAGESTATS=false
8
+
9
+ WORKDIR /app
10
+
11
+ # Install Python dependencies
12
+ COPY requirements.txt .
13
+ RUN python -m pip install --upgrade pip && \
14
+ pip install -r requirements.txt
15
+
16
+ # Copy app code
17
+ COPY . .
18
+
19
+ # Start Streamlit on the port provided by HF Spaces (fallback to 7860)
20
+ # Also unset STREAMLIT_SERVER_PORT to avoid empty env var issues
21
+ CMD ["bash", "-lc", "unset STREAMLIT_SERVER_PORT; exec streamlit run main.py --server.address=0.0.0.0 --server.port=${PORT:-7860}"]