OpenClaw / Dockerfile
ApolloAIs's picture
Update Dockerfile
bbd070b verified
Raw History Blame Contribute Delete
979 Bytes
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"]