mirror of
https://github.com/maciejpedzich/playlist-entry-validator.git
synced 2024-11-27 16:05:48 +01:00
2nd attempt at optimising and hardening Docker image
This commit is contained in:
parent
979d77cca5
commit
c0886b73e5
10
Dockerfile
10
Dockerfile
@ -1,11 +1,15 @@
|
|||||||
FROM node:lts-alpine AS build
|
FROM node:lts-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm i
|
RUN npm ci
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM node:lts-alpine AS runtime
|
FROM node:lts-alpine AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/dist /app
|
ENV NODE_ENV production
|
||||||
CMD ["node", "./index.js"]
|
USER node
|
||||||
|
COPY --chown=node:node package*.json ./
|
||||||
|
RUN npm ci --production
|
||||||
|
COPY --from=builder --chown=node:node /app/dist ./dist
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
CMD ["node", "./dist/index.js"]
|
||||||
|
Loading…
Reference in New Issue
Block a user