File size: 979 Bytes
9682cc7
5858c63
da1ce13
 
 
 
 
 
5858c63
 
da1ce13
 
 
bbd070b
 
da1ce13
bbd070b
da1ce13
 
 
bbd070b
5858c63
 
 
 
 
 
 
da1ce13
5858c63
bbd070b
5858c63
 
 
 
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.11

# 1. Stay as ROOT to install all heavy system dependencies
USER root

RUN apt-get update && apt-get install -y \
    wget curl git build-essential \
    libnss3 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgbm1 \
    && rm -rf /var/lib/apt/lists/*

# 2. Upgrade pip to the absolute latest version
RUN pip install --no-cache-dir --upgrade pip setuptools wheel

# 3. Install core Python packages (Skipping openclaw entirely)
RUN pip install --no-cache-dir fastapi uvicorn python-dotenv aiofiles litellm playwright

# 4. Install Playwright OS dependencies AS ROOT
RUN playwright install chromium
RUN playwright install-deps chromium

# 5. Switch to the required Hugging Face user
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONUNBUFFERED=1

WORKDIR $HOME/app
RUN mkdir -p $HOME/app/static

# 6. Copy the Python code and give ownership
COPY --chown=user . .

EXPOSE 7860
CMD ["python", "main.py"]