-
-
Notifications
You must be signed in to change notification settings - Fork 625
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust Dockerfile to use multi-stage builds
- Loading branch information
Showing
1 changed file
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |