pcsales / Dockerfile
omgy's picture
Create Dockerfile
3e952ea verified
raw
history blame contribute delete
632 Bytes
FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
STREAMLIT_SERVER_HEADLESS=true \
STREAMLIT_BROWSER_GATHERUSAGESTATS=false
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN python -m pip install --upgrade pip && \
pip install -r requirements.txt
# Copy app code
COPY . .
# Start Streamlit on the port provided by HF Spaces (fallback to 7860)
# Also unset STREAMLIT_SERVER_PORT to avoid empty env var issues
CMD ["bash", "-lc", "unset STREAMLIT_SERVER_PORT; exec streamlit run main.py --server.address=0.0.0.0 --server.port=${PORT:-7860}"]