Update Dockerfile
Browse files- Dockerfile +6 -8
Dockerfile
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
FROM node:22-slim
|
| 2 |
|
| 3 |
-
# 1. ติดตั้ง Dependencies
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
git build-essential python3 python3-pip \
|
| 6 |
g++ make ca-certificates \
|
| 7 |
-
# เหล่านี้คือ Libs ที่ Chrome ขาดไม่ได้ใน Linux Slim
|
| 8 |
libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 \
|
| 9 |
libdrm2 libdbus-1-3 libxcb1 libxkbcommon0 libx11-6 libxcomposite1 \
|
| 10 |
libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 \
|
|
@@ -12,19 +11,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 12 |
&& npm install -g pnpm \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
# ติดตั้ง huggingface hub (ถ้าจำเป็นต้องใช้โหลดโมเดล)
|
| 16 |
RUN pip3 install --no-cache-dir huggingface_hub --break-system-packages
|
| 17 |
|
| 18 |
-
# 2. Clone OpenClaw
|
| 19 |
WORKDIR /app
|
| 20 |
-
RUN git clone --depth 1 https://github.com/openclaw/openclaw.git
|
| 21 |
|
| 22 |
-
# 3. ติดตั้ง
|
| 23 |
RUN pnpm install && \
|
| 24 |
pnpm ui:build && \
|
| 25 |
pnpm build
|
| 26 |
|
| 27 |
-
# 4. ติดตั้ง Playwright Chromium
|
| 28 |
RUN npx playwright install chromium
|
| 29 |
|
| 30 |
# 5. ตั้งค่าสภาพแวดล้อม
|
|
@@ -34,5 +32,5 @@ RUN chmod +x start_openclaw.sh
|
|
| 34 |
|
| 35 |
EXPOSE 7860
|
| 36 |
|
| 37 |
-
# 6. รัน
|
| 38 |
CMD ["pnpm", "openclaw", "gateway", "--port", "7860"]
|
|
|
|
| 1 |
FROM node:22-slim
|
| 2 |
|
| 3 |
+
# 1. ติดตั้ง Dependencies และ Libs สำหรับ Chrome
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
git build-essential python3 python3-pip \
|
| 6 |
g++ make ca-certificates \
|
|
|
|
| 7 |
libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 \
|
| 8 |
libdrm2 libdbus-1-3 libxcb1 libxkbcommon0 libx11-6 libxcomposite1 \
|
| 9 |
libxdamage1 libxext6 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 \
|
|
|
|
| 11 |
&& npm install -g pnpm \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
|
|
|
| 14 |
RUN pip3 install --no-cache-dir huggingface_hub --break-system-packages
|
| 15 |
|
| 16 |
+
# 2. Clone OpenClaw (ระบุจุด "." เพื่อลงใน /app โดยตรง ไม่ต้อง cd)
|
| 17 |
WORKDIR /app
|
| 18 |
+
RUN git clone --depth 1 https://github.com/openclaw/openclaw.git .
|
| 19 |
|
| 20 |
+
# 3. ติดตั้งและ Build (ตอนนี้อยู่ถูกที่แล้ว pnpm จะเห็นไฟล์ครบ)
|
| 21 |
RUN pnpm install && \
|
| 22 |
pnpm ui:build && \
|
| 23 |
pnpm build
|
| 24 |
|
| 25 |
+
# 4. ติดตั้ง Playwright Chromium
|
| 26 |
RUN npx playwright install chromium
|
| 27 |
|
| 28 |
# 5. ตั้งค่าสภาพแวดล้อม
|
|
|
|
| 32 |
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
+
# 6. รัน Gateway
|
| 36 |
CMD ["pnpm", "openclaw", "gateway", "--port", "7860"]
|