-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (35 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
51 lines (35 loc) · 1.01 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
# Skolverket MCP Server - Docker Container
# Multi-stage build för optimal image storlek
# Stage 1: Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Kopiera package files
COPY package*.json ./
COPY tsconfig.json ./
# Installera ALLA dependencies (skippa prepare script tills vi har source code)
RUN npm ci --ignore-scripts
# Kopiera source code
COPY src ./src
# Bygg TypeScript
RUN npm run build
# Stage 2: Production stage
FROM node:20-alpine
WORKDIR /app
# Kopiera package files
COPY package*.json ./
# Installera BARA production dependencies (skippa prepare script)
RUN npm ci --only=production --ignore-scripts
# Kopiera byggda filer från builder stage
COPY --from=builder /app/dist ./dist
# Kopiera public directory med social media images
COPY public ./public
# Skapa logs directory
RUN mkdir -p logs
# Exponera port
EXPOSE 3000
# Environment variables
ENV NODE_ENV=production
ENV PORT=3000
ENV LOG_LEVEL=info
# Starta Streamable HTTP server (MCP över SSE)
CMD ["node", "dist/streamable-http-server.js"]