File size: 1,051 Bytes
e65a846
 
 
 
 
b9f599a
 
 
e65a846
 
03a5603
e65a846
03a5603
e65a846
 
 
 
 
 
 
 
 
 
03a5603
e65a846
 
b9f599a
 
 
03a5603
b9f599a
 
 
e65a846
b9f599a
e65a846
 
b9f599a
 
 
 
 
e65a846
b9f599a
 
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
39
40
41
42
43
44
45
FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1

WORKDIR /app

# Install system deps + git
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        git \
        curl \
        ca-certificates \
        libnss3 \
        libatk1.0-0 \
        libatk-bridge2.0-0 \
        libcups2 \
        libdrm2 \
        libxkbcommon0 \
        libxcomposite1 \
        libxdamage1 \
        libxrandr2 \
        libgbm1 \
        libasound2 && \
    rm -rf /var/lib/apt/lists/*

# Copy and install Python dependencies (FastAPI, etc.)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Clone and install perplexity-ai in editable mode WITH [driver]
RUN git clone https://github.com/helallao/perplexity-ai.git ./perplexity-ai
RUN pip install --no-cache-dir -e ./perplexity-ai[driver]

# Install Chromium for patchright
RUN patchright install chromium

# Copy app
COPY main.py .

# Expose port 7860
EXPOSE 7860

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