File size: 785 Bytes
5f97d51
fa4959b
 
 
271461a
fa4959b
 
 
 
 
271461a
fa4959b
 
 
 
c68a7b4
fa4959b
271461a
fa4959b
271461a
fa4959b
 
271461a
fa4959b
271461a
fa4959b
 
 
 
 
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
FROM python:3.11-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    git \
    && rm -rf /var/lib/apt/lists/*

# Set environment variables for Hugging Face cache & config (for writable directories)
ENV HOME=/app
ENV XDG_CONFIG_HOME=/app/.config
ENV XDG_CACHE_HOME=/app/.cache

RUN mkdir -p /app/.config /app/.cache/huggingface && chmod -R 777 /app/.cache

# Copy requirements first for layer caching and install dependencies
COPY requirements.txt ./

RUN pip install --upgrade pip && \
    pip install --upgrade ibm-watsonx-orchestrate && \
    pip install --no-cache-dir -r requirements.txt

# Copy the rest of your source code
COPY . .

EXPOSE 7860

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]