-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 701 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (31 loc) · 701 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
38
39
40
FROM node:20-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
FROM node:20-slim
# Install system tools needed by shell/network tools
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
netcat-openbsd \
dnsutils \
whois \
traceroute \
iputils-ping \
procps \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package*.json ./
RUN npm install --omit=dev
COPY --from=builder /app/dist ./dist/
EXPOSE 3000
# Non-root user for safety
RUN useradd -m mcpuser && \
mkdir -p /host-home && \
chown -R mcpuser /app /host-home
USER mcpuser
CMD ["node", "dist/server.js"]