ava/Dockerfile

34 lines
981 B
Docker
Raw Normal View History

2024-07-11 02:38:57 -07:00
# skidded off https://git.madhouselabs.net/MadHouse-Labs/file-uploader/src/branch/master/Dockerfile
FROM node:lts-alpine AS base
WORKDIR /usr/src/app
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json package-lock.json /temp/dev/
RUN cd /temp/dev && npm install
RUN mkdir -p /temp/prod
COPY package.json package-lock.json /temp/prod/
2024-11-20 20:41:24 -08:00
RUN cd /temp/prod && npm install --omit dev --include=optional
2024-07-11 02:38:57 -07:00
FROM base AS prisma
COPY --from=install /temp/prod/node_modules node_modules
COPY . .
RUN npx prisma generate
2024-07-11 05:43:41 -07:00
FROM base AS build
2024-07-11 02:38:57 -07:00
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
RUN npx prisma generate
# vite build
2024-07-11 05:45:02 -07:00
RUN NODE_ENV=production npm run build
2024-07-11 02:38:57 -07:00
2024-07-11 05:40:07 -07:00
FROM base AS release
2024-07-11 02:38:57 -07:00
COPY --from=prisma /usr/src/app/prisma prisma
COPY --from=prisma /usr/src/app/node_modules node_modules
COPY --from=build /usr/src/app/build build
2024-07-12 01:49:22 -07:00
COPY --from=build /usr/src/app/assets assets
2024-07-11 02:38:57 -07:00
COPY --from=build /usr/src/app/package.json .
EXPOSE 3000/tcp
2024-07-11 05:40:07 -07:00
CMD [ "node", "build" ]