-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (45 loc) · 1.25 KB
/
Dockerfile
File metadata and controls
63 lines (45 loc) · 1.25 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
# Build stage
FROM node:22-bookworm AS builder
# Install build dependencies
RUN apt-get update && \
apt-get install -y python3 make g++ && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Build the project
RUN npm run build
# Production stage
FROM node:22-bookworm
# Install Firefox ESR for RDP debugging
RUN apt-get update && \
apt-get install -y firefox-esr && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --only=production && npm cache clean --force
# Copy built files from builder stage
COPY --from=builder /app/dist ./dist
# Create non-root user
RUN groupadd -g 1001 -r nodejs && \
useradd -r -g nodejs -u 1001 nodejs
# Change ownership of the app directory
RUN chown -R nodejs:nodejs /app
USER nodejs
# Set environment variables
ENV NODE_ENV=production \
RDP_HOST=127.0.0.1 \
RDP_PORT=6000 \
FIREFOX_HEADLESS=true \
AUTO_LAUNCH_FIREFOX=false \
VIEWPORT=1280x720
# MCP server runs on stdio (no port exposure needed)
# If Firefox RDP is needed from outside: EXPOSE 6000
# Start the MCP server
CMD ["node", "dist/index.js"]