Staged Docker builds for dev and prod

This commit is contained in:
2022-10-11 16:24:15 +03:00
parent dde5a13550
commit 693ab863c2
5 changed files with 35 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
# pull official node image
FROM node
FROM node AS dev
# define /app as working directory
WORKDIR /app
@@ -13,4 +13,10 @@ RUN npm install
COPY . /app
# launch node server
ENTRYPOINT npm run dev
# production
FROM node AS prod
WORKDIR /app
COPY --from=dev /app ./
ENTRYPOINT npm run start