-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
43 lines (30 loc) · 1.15 KB
/
Dockerfile
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
FROM node:22-alpine AS builder
WORKDIR /build
# Copy LICENSE file.
COPY LICENSE ./
# Copy the relevant package.json and package-lock.json files.
COPY package*.json ./
COPY packages/api/package*.json ./packages/api/
COPY packages/addon/package*.json ./packages/addon/
# Install dependencies.
RUN npm install
# Copy source files.
COPY tsconfig.*json ./
COPY packages/api ./packages/api
COPY packages/addon ./packages/addon
# Build the project.
RUN npm run build
# Remove development dependencies.
RUN npm --workspaces prune --omit=dev
FROM node:22-alpine AS final
WORKDIR /app
# Copy the built files from the builder.
# The package.json files must be copied as well for NPM workspace symlinks between local packages to work.
COPY --from=builder /build/package*.json /build/LICENSE ./
COPY --from=builder /build/packages/addon/package.*json ./packages/addon/
COPY --from=builder /build/packages/api/package.*json ./packages/api/
COPY --from=builder /build/packages/addon/dist ./packages/addon/dist
COPY --from=builder /build/packages/api/dist ./packages/api/dist
COPY --from=builder /build/node_modules ./node_modules
EXPOSE 1337
ENTRYPOINT ["npm", "run", "start:addon"]