renminwansui1976 commited on
Commit
100b909
·
unverified ·
1 Parent(s): 80a465e

更新 Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -1
Dockerfile CHANGED
@@ -1 +1,36 @@
1
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1
2
+
3
+ FROM rust:1.75-slim AS builder
4
+ WORKDIR /build
5
+
6
+ COPY Cargo.toml ./
7
+ COPY src ./src
8
+ RUN cargo build --release
9
+
10
+ FROM node:20-bookworm-slim AS runtime
11
+
12
+ ENV DEBIAN_FRONTEND=noninteractive
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ ca-certificates curl unzip \
15
+ libnss3 libatk-bridge2.0-0 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 \
16
+ libxrandr2 libgbm1 libasound2 libatk1.0-0 libcups2 libdrm2 libdbus-1-3 libgtk-3-0 \
17
+ libx11-xcb1 libxshmfence1 libxext6 libx11-6 fonts-liberation \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ RUN useradd -m -u 1000 -s /bin/bash user
21
+ USER user
22
+ WORKDIR /home/user/app
23
+
24
+ ENV HOME=/home/user
25
+ ENV PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright
26
+ RUN npx playwright install chromium
27
+
28
+ USER root
29
+ COPY --from=builder /build/target/release/openclaw-hf-sync /usr/local/bin/openclaw-hf-sync
30
+ RUN chmod +x /usr/local/bin/openclaw-hf-sync \
31
+ && mkdir -p /home/user/.openclaw/workspace /home/user/app \
32
+ && chown -R user:user /home/user
33
+
34
+ USER user
35
+ WORKDIR /home/user/app
36
+ ENTRYPOINT ["/usr/local/bin/openclaw-hf-sync"]