-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
36 lines (29 loc) · 1.08 KB
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
36
# Build stage — compile React frontend
FROM node:22-alpine AS builder
WORKDIR /app
# Firebase config passed at build time (Vite bakes VITE_* into the bundle)
ARG VITE_FIREBASE_API_KEY
ARG VITE_FIREBASE_AUTH_DOMAIN
ARG VITE_FIREBASE_PROJECT_ID
ARG VITE_GA_ID
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Runtime stage — Node.js with server + compiled frontend
FROM node:22-alpine
WORKDIR /app
COPY --from=builder /app/package.json ./package-full.json
RUN node -e "const p=require('./package-full.json'); const s={type:'module',version:p.version,dependencies:{express:'^5.2.1','express-rate-limit':'^8.3.0','http-proxy':'^1.18.1',jsonwebtoken:'^9.0.3','js-yaml':'^4.1.1'}}; require('fs').writeFileSync('package.json',JSON.stringify(s))" \
&& rm package-full.json && npm install --production \
&& npm install -g clawhub
COPY --from=builder /app/dist ./dist
COPY server.js .
COPY server/ ./server/
COPY templates/ ./templates/
EXPOSE 3001
ENV PORT=3001 \
NODE_ENV=production \
OPENCLAW_PORT=18789 \
FIREBASE_PROJECT_ID=silos-4352a
CMD ["node", "server.js"]