-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 799 Bytes
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 799 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
# Build stage
FROM node:20-alpine AS build
# Set working directory
WORKDIR /app
# Copy package files for dependency installation
COPY package.json package-lock.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the application code
COPY . .
# Build the TypeScript application
RUN npm run build
# Production stage
FROM node:20-alpine AS production
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json package-lock.json ./
# Install only production dependencies
RUN npm ci --production
# Copy built application from build stage
COPY --from=build /app/dist ./dist
COPY --from=build /app/templates ./templates
# Expose the HTTP port
EXPOSE 3000
# Set the default command to run the server with HTTP transport
CMD ["node", "dist/index.js", "--transport=http"]