-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 1.22 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (37 loc) · 1.22 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Multi-stage Dockerfile for Brain Agent Platform
# Phase 6: Docker containerization
# Stage 1: Builder
FROM node:22-alpine AS builder
WORKDIR /build
# Install dependencies
COPY package*.json ./
RUN npm ci --only=production && \
npm cache clean --force
# Copy source
COPY . .
# Install Playwright browsers (needed for browser-relay)
RUN npx playwright install --with-deps chromium
# Stage 2: Runtime
FROM node:22-alpine
LABEL maintainer="Brain Agent Platform"
LABEL description="Standalone autonomous agent runtime platform"
LABEL version="5.0.0"
WORKDIR /app
# Create non-root user
RUN addgroup -g 1001 -S brain && \
adduser -S brain -u 1001
# Copy from builder
COPY --from=builder /build ./
COPY --from=builder /root/.cache/ms-playwright /home/brain/.cache/ms-playwright
# Create working directory for sessions
RUN mkdir -p /data && \
chown -R brain:brain /app /data
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD node -e "require('http').get('http://localhost:18789/health', (r) => { if(r.statusCode!==200) throw new Error(); })" || exit 1
# Expose ports
EXPOSE 18789 3001 3003 3000
# Switch to non-root user
USER brain
# Default command
CMD ["node", "bin/brain", "start"]