-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (30 loc) · 1 KB
/
Dockerfile
File metadata and controls
42 lines (30 loc) · 1 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
# Google Calendar MCP Server - Optimized Dockerfile
# syntax=docker/dockerfile:1
FROM node:18-alpine
# Create app user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S -u 1001 -G nodejs nodejs
# Set working directory
WORKDIR /app
# Copy package files for dependency caching
COPY package*.json ./
# Copy build scripts and source files needed for build
COPY scripts ./scripts
COPY src ./src
COPY tsconfig.json .
# Install all dependencies (including dev dependencies for build)
RUN npm ci --no-audit --no-fund --silent
# Build the project
RUN npm run build
# Remove dev dependencies to reduce image size
RUN npm prune --production --silent
# Create config directory and set permissions
RUN mkdir -p /home/nodejs/.config/google-calendar-mcp && \
chown -R nodejs:nodejs /home/nodejs/.config && \
chown -R nodejs:nodejs /app
# Switch to non-root user
USER nodejs
# Expose port for HTTP mode (optional)
EXPOSE 3000
# Default command - run directly to avoid npm output
CMD ["node", "build/index.js"]