chore: clean Dockerfile (remove openclaw dep), delete stale data/, fix .dockerignore
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
node_modules
|
||||
dist
|
||||
.output
|
||||
src-tauri
|
||||
releases
|
||||
tmp
|
||||
research
|
||||
|
||||
23
Dockerfile
23
Dockerfile
@@ -2,24 +2,13 @@
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Skip Playwright browser download (not needed for production)
|
||||
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
|
||||
|
||||
COPY package.json package-lock.json .npmrc ./
|
||||
RUN npm ci
|
||||
COPY package.json pnpm-lock.yaml .npmrc ./
|
||||
RUN npm install -g pnpm && pnpm install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# --- Fetch built-in Hermes-compatible skills ---
|
||||
FROM node:22-alpine AS skills
|
||||
WORKDIR /tmp
|
||||
RUN apk add --no-cache git && \
|
||||
npm install --global --ignore-scripts openclaw@latest
|
||||
# Copy just the skills directory
|
||||
RUN SKILLS_DIR=$(npm root -g)/openclaw/skills && \
|
||||
mkdir -p /openclaw-skills && \
|
||||
if [ -d "$SKILLS_DIR" ]; then cp -r "$SKILLS_DIR"/* /openclaw-skills/; fi
|
||||
RUN pnpm build
|
||||
|
||||
# --- Production stage ---
|
||||
FROM node:22-alpine AS runner
|
||||
@@ -27,19 +16,13 @@ WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup -S hermes && adduser -S hermes -G hermes
|
||||
|
||||
# Copy build output and package.json (for any runtime deps)
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/package.json ./
|
||||
COPY --from=builder /app/server-entry.js ./
|
||||
|
||||
# Copy built-in Hermes-compatible skills
|
||||
COPY --from=skills /openclaw-skills ./openclaw-skills
|
||||
|
||||
# Expose default port
|
||||
EXPOSE 3000
|
||||
|
||||
USER hermes
|
||||
|
||||
Reference in New Issue
Block a user