Files
nodejs-web-template/Dockerfile
Cory Sanin 237d076668
Some checks failed
NPM Audit Check / Check NPM audit (push) Has been cancelled
App Image CI / Build app image (push) Has been cancelled
Initial commit
2025-10-09 18:48:59 -05:00

36 lines
591 B
Docker

FROM node:lts-alpine AS base
FROM base AS build-env
WORKDIR /usr/src/app
RUN apk add --no-cache libwebp libwebp-tools libavif-apps
COPY package*.json ./
RUN npm install
COPY . .
RUN npx tsc && npm run-script build && \
npm ci --only=production && \
ln -sf /usr/share/fonts assets/ && \
chown -R node .
FROM base AS deploy
HEALTHCHECK --timeout=3s \
CMD curl --fail http://localhost:8080/healthcheck || exit 1
EXPOSE 8080
WORKDIR /usr/src/app
RUN apk add --no-cache curl
COPY --from=build-env /usr/src/app /usr/src/app
USER node
CMD [ "node", "distribution/index.js"]