sudoku-api/Dockerfile

26 lines
481 B
Docker
Raw Permalink Normal View History

2021-02-19 18:30:02 -07:00
# dev stage
FROM node:14-alpine as dev
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
# build stage
FROM dev as build
RUN npx tsc && npm prune --production
# production stage
FROM node:14-alpine
WORKDIR /app
2021-02-25 00:38:11 -07:00
RUN apk add --update --no-cache util-linux
2021-02-19 18:30:02 -07:00
# Copy over production modules and dist folder
COPY --from=build /app/package*.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
EXPOSE 4000
CMD [ "node", "dist/main.js" ]