24 lines
630 B
Docker
24 lines
630 B
Docker
FROM node:20-alpine as builder
|
|
|
|
WORKDIR /app
|
|
COPY package.json .
|
|
COPY yarn.lock .
|
|
COPY tsconfig.json .
|
|
COPY src .
|
|
RUN apk add --no-cache vips-dev alpine-sdk && \
|
|
yarn install --frozen-lockfile --ignore-scripts && \
|
|
npm rebuild sharp --build-from-source && \
|
|
NODE_ENV=production yarn build && \
|
|
yarn install --production --frozen-lockfile --ignore-scripts && \
|
|
npm rebuild sharp --build-from-source
|
|
|
|
FROM node:20-alpine as runner
|
|
|
|
WORKDIR /app
|
|
RUN apk add --no-cache vips-cpp
|
|
COPY package.json .
|
|
COPY --from=builder /app/node_modules /app/node_modules
|
|
COPY --from=builder /app/dist /app/dist
|
|
EXPOSE 8009
|
|
CMD ["yarn", "start"]
|