Sarcastic-AI / Dockerfile
hg-goswami's picture
Update Dockerfile
7661877 verified
raw
history blame contribute delete
818 Bytes
# 1. Use Python 3.10 (REQUIRED for Unsloth/Torch compatibility)
FROM python:3.10-slim
# 2. Setup a non-root user (REQUIRED for HF Spaces security)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# 3. Set working directory
WORKDIR $HOME/app
# 4. Copy files with correct permissions
# We copy everything (.) to the workdir. This includes 'src/' and 'requirements.txt'
COPY --chown=user . $HOME/app
# 5. Install dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# 6. Expose the Standard HF Port (7860)
EXPOSE 8501
# 7. Launch Command
# We point to 'src/streamlit_app.py' but force it to listen on port 7860
CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]