Update Dockerfile

This commit is contained in:
2022-03-05 22:21:33 +07:00
parent da8fbef5dd
commit f94fe9c194
+23 -11
View File
@@ -1,23 +1,35 @@
FROM debian FROM debian AS build
RUN mkdir -p /home/node/app/node_modules
WORKDIR /home/node/app WORKDIR /home/node/app
COPY package*.json ./ COPY . .
COPY prisma ./prisma/
RUN DEBIAN_FRONTEND=noninteractive RUN DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y RUN apt-get update -y
RUN apt-get -y install curl gnupg git python2 make g++ iputils-ping ffmpeg RUN apt-get -y install curl gnupg git python2 make g++ iputils-ping ffmpeg
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash - RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -
RUN apt-get -y install nodejs RUN apt-get -y install nodejs
RUN npm i -g yarn RUN npm i -g yarn
RUN yarn RUN yarn
RUN yarn prisma generate
COPY . .
RUN yarn build RUN yarn build
CMD [ "yarn", "start"]
FROM debian
WORKDIR /home/node/app
RUN apt-get update -y
RUN apt-get -y install curl gnupg git python2 make g++ iputils-ping ffmpeg
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -
RUN apt-get -y install nodejs
RUN npm i -g yarn
COPY --from=build /home/node/app/package.json .
COPY --from=build /home/node/app/yarn.lock .
RUN yarn
COPY --from=build /home/node/app/prisma ./prisma/
RUN yarn prisma generate
COPY --from=build /home/node/app/build .
CMD [ "node", "index.js"]