24 lines
570 B
Docker
24 lines
570 B
Docker
FROM node:22.18.0-alpine3.22 AS dependencies
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --ignore-scripts
|
|
|
|
FROM dependencies AS test
|
|
COPY tsconfig.json tsconfig.build.json ./
|
|
COPY src ./src
|
|
COPY test ./test
|
|
CMD ["npm", "test"]
|
|
|
|
FROM dependencies AS build
|
|
COPY tsconfig.json tsconfig.build.json ./
|
|
COPY src ./src
|
|
RUN npm run build
|
|
|
|
FROM node:22.18.0-alpine3.22 AS production
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
COPY package.json ./
|
|
COPY --from=build /app/dist ./dist
|
|
USER node
|
|
CMD ["node", "--input-type=module", "--eval", "import('@gaza/protocol')"]
|