Skip to content

Commit

Permalink
Adjust Dockerfile to use multi-stage builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Kovah authored and jlongster committed Apr 30, 2022
1 parent 59ec877 commit 2bb3e3e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# base node image
FROM node:16-bullseye as base

RUN apt-get update && apt-get install -y openssl

RUN mkdir /app
WORKDIR /app
ENV NODE_ENV=production

ADD . .

RUN yarn install --production
RUN mkdir ./server-files
RUN mkdir ./user-files

FROM node:16-bullseye-slim as prod

RUN apt-get update && apt-get install openssl && apt-get clean -y && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=base /app /app
CMD ["yarn", "start"]

0 comments on commit 2bb3e3e

Please sign in to comment.