Skip to content
Snippets Groups Projects
Commit 2bb3e3ea authored by Kovah's avatar Kovah Committed by James Long
Browse files

Adjust Dockerfile to use multi-stage builds

parent 59ec877d
Branches
No related tags found
No related merge requests found
# base node image
FROM node:16-bullseye as base FROM node:16-bullseye as base
RUN apt-get update && apt-get install -y openssl RUN apt-get update && apt-get install -y openssl
RUN mkdir /app RUN mkdir /app
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
ADD . . ADD . .
RUN yarn install --production 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"] CMD ["yarn", "start"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment