-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 878 Bytes
/
Dockerfile
File metadata and controls
35 lines (24 loc) · 878 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
FROM node:20-alpine AS builder
# Create app directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies, ignoring any prepare scripts
RUN npm install --ignore-scripts
# Copy the rest of the application code
COPY src ./src/
COPY tsconfig.json ./
# Build the application
RUN npm run build
# Use Node.js 20 Alpine as the base image for the runtime stage
FROM node:20-alpine AS runner
# Set the working directory for the runtime stage
WORKDIR /app
# Copy the built application and dependencies from the builder stage
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/build ./build
RUN npm install --ignore-scripts --omit=dev
# Define environment variable for markmap data directory
ENV MARKMAP_DIR=/data/markmap
# Define the command to run when the container starts
ENTRYPOINT ["node", "build/index.js"]