File size: 1,018 Bytes
c3c8698
 
 
 
411f074
 
c3c8698
411f074
 
 
c3c8698
411f074
 
c3c8698
411f074
4cb5342
3bfd80a
 
4cb5342
c3c8698
411f074
 
 
 
4cb5342
c3c8698
506cb53
 
 
411f074
 
c3c8698
411f074
5588ba1
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
FROM python:3.11

WORKDIR /app

# Copy requirements first for better caching
COPY requirements.txt /app/

# Install dependencies and upgrade pip
RUN pip install --no-cache-dir --upgrade pip \
    && pip install --no-cache-dir -r requirements.txt

# Copy remaining application code
COPY . /app

# Create logs directory with proper permissions
RUN mkdir -p /app/logs /app/.cache/huggingface && chmod -R 777 /app/logs /app/.cache/huggingface
RUN mkdir -p /app/src/backend/data && chmod 775 /app/src/backend/data



# Install additional dependencies
RUN apt-get update && apt-get install -y tmux curl

# Ensure the Hugging Face cache is set correctly
ENV HF_HOME="/app/.cache/huggingface"

# Set Python path
ENV PYTHONPATH="/app/src"

# Expose ports for both FastAPI (8000) and Streamlit (7860)
EXPOSE 8000 7860

# Combined startup with better control
CMD ["sh", "-c", "fastapi dev src/backend/main.py --host 0.0.0.0 --port 8000 & sleep 5 && streamlit run src/frontend/home.py --server.port 7860 --server.address 0.0.0.0"]