noteshare.space/server/Dockerfile

26 lines
384 B
Docker
Raw Normal View History

2023-05-29 21:50:21 +03:00
FROM node:16 AS BUILD_IMAGE
2022-07-02 22:14:07 +03:00
2022-07-01 23:06:50 +03:00
# install dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# Copy all local files into the image.
COPY . .
RUN npx prisma generate
RUN npm run build
# remove development dependencies
RUN npm prune --production
2023-05-29 21:50:21 +03:00
FROM node:16
2022-07-01 23:06:50 +03:00
WORKDIR /app
COPY --from=0 /app .
2022-07-02 22:14:07 +03:00
ENV PORT 8080
2022-07-01 23:06:50 +03:00
EXPOSE 8080
CMD ["node", "./build/src/server.js"]