Spaces:
Running
Running
File size: 955 Bytes
8586e58 e4ba0e9 8586e58 e83f844 8586e58 e83f844 e4ba0e9 9cfb582 e4ba0e9 8586e58 52adbed 8586e58 7f93129 9234853 e4ba0e9 8586e58 e83f844 0d40d08 |
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 33 34 35 36 37 38 |
FROM python:3.10-slim
WORKDIR /code
# System dependencies
RUN apt-get update && apt-get install -y \
libsndfile1 ffmpeg git \
&& rm -rf /var/lib/apt/lists/*
# Copy project files
COPY . /code
# Set safe cache + config + data paths
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV HF_HOME=/tmp/hf-home
ENV TRANSFORMERS_CACHE=/tmp/hf-cache
ENV NLTK_DATA=/tmp/nltk_data
# Fix Streamlit writing to restricted folder
ENV HOME=/tmp
ENV XDG_CONFIG_HOME=/tmp
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN pip install fastapi uvicorn transformers openai python-multipart gtts pillow pandas streamlit
# ✅ Allow Streamlit to write telemetry & config
RUN mkdir -p /tmp/.streamlit && chmod -R 777 /tmp/.streamlit
# Expose ports
EXPOSE 7860
EXPOSE 8000
# Final launch command
CMD ["bash", "-c", "streamlit run frontend.py --server.port 7860 & uvicorn main:app --host 0.0.0.0 --port 8000"]
|