File size: 860 Bytes
8586e58
 
 
 
e4ba0e9
8586e58
 
 
 
e83f844
8586e58
 
e83f844
e4ba0e9
 
 
 
 
e83f844
 
e4ba0e9
 
8586e58
 
 
e83f844
e4ba0e9
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
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
ENV HOME=/tmp                # πŸ‘ˆ fixes default fallback for Streamlit
ENV XDG_CONFIG_HOME=/tmp     # πŸ‘ˆ fixes config path

# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# Create writable .streamlit config folder
RUN mkdir -p /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"]