File size: 682 Bytes
f42f9ee
bcd29be
e9de28d
bcd29be
 
 
 
f42f9ee
bcd29be
 
333b86f
e9de28d
333b86f
 
9e95e01
 
 
333b86f
 
 
bcd29be
333b86f
bcd29be
 
333b86f
f42f9ee
 
333b86f
e9de28d
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.10-slim

# Set up user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set working directory
WORKDIR /app

# Upgrade pip and install requirements
COPY --chown=user backend/requirements.txt ./requirements.txt

# Force clean, fixed installs
RUN pip install --upgrade pip && \
    pip uninstall -y transformers peft || true && \
    pip install --no-cache-dir -r requirements.txt && \
    pip install --no-cache-dir \
        transformers==4.31.0 \
        peft==0.5.0

# Copy project code
COPY --chown=user . .

# Expose FastAPI port
EXPOSE 7860

# Start app
CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"]