This repository was archived by the owner on Feb 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
105 lines (87 loc) · 2.47 KB
/
Dockerfile
File metadata and controls
105 lines (87 loc) · 2.47 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Build stage
FROM node:20-bookworm-slim AS builder
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package*.json ./
COPY packages/shared/package*.json ./packages/shared/
COPY packages/orchestrator/package*.json ./packages/orchestrator/
COPY packages/frontend/package*.json ./packages/frontend/
# Install dependencies
RUN npm install
# Copy source files
COPY tsconfig.base.json ./
COPY packages/shared ./packages/shared
COPY packages/orchestrator ./packages/orchestrator
COPY packages/frontend ./packages/frontend
# Build all packages
RUN npm run build -w @cloud-sandbox/shared
RUN npm run build -w @cloud-sandbox/orchestrator
RUN npm run build -w @cloud-sandbox/frontend
# Production stage
FROM node:20-bookworm-slim
# Install Chromium and dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium \
fonts-liberation \
fonts-noto-color-emoji \
fonts-noto-cjk \
fonts-freefont-ttf \
libnss3 \
libxss1 \
libasound2 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libgtk-3-0 \
libnspr4 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libx11-6 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxrandr2 \
libxshmfence1 \
ca-certificates \
curl \
# For node-pty
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Set Playwright to use system Chromium
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
WORKDIR /app
# Copy built files
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/packages/shared/package*.json ./packages/shared/
COPY --from=builder /app/packages/shared/dist ./packages/shared/dist
COPY --from=builder /app/packages/orchestrator/package*.json ./packages/orchestrator/
COPY --from=builder /app/packages/orchestrator/dist ./packages/orchestrator/dist
COPY --from=builder /app/packages/frontend/dist ./packages/frontend/dist
# Install production dependencies only
RUN npm install --omit=dev
# Rebuild native modules
RUN npm rebuild node-pty
# Create data directory
RUN mkdir -p /app/data/users && chown -R node:node /app/data
# Use non-root user
USER node
EXPOSE 8000
ENV NODE_ENV=production
ENV PORT=8000
ENV HOST=0.0.0.0
CMD ["node", "packages/orchestrator/dist/index.js"]