-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (29 loc) · 942 Bytes
/
Dockerfile
File metadata and controls
37 lines (29 loc) · 942 Bytes
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
# Use official Node.js LTS image based on Debian
FROM node:20-bullseye
# Install build and X11-related deps needed by native modules like robotjs
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
python3 \
pkg-config \
libcairo2-dev \
libx11-dev \
libxkbfile-dev \
libxtst-dev \
libpng-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy package manifests and install dependencies first (layer caching)
COPY package*.json ./
# Install production dependencies (use npm ci for reproducible installs)
RUN npm ci --only=production
# Copy source
COPY . /app
# Run as unprivileged user for safety
RUN useradd --user-group --create-home --shell /bin/false appuser \
&& chown -R appuser:appuser /app
USER appuser
ENV NODE_ENV=production
# This project runs as a stdio MCP server; no HTTP port is required
CMD ["node", "server.js"]