brawlset/app/Dockerfile

28 lines
590 B
Docker

FROM node:alpine AS build
WORKDIR /app
COPY package.json ./
# install dependencies
RUN npm install
COPY . .
# build
RUN npx prisma generate
RUN npm run build
# remove dev dependencies
RUN npm prune --production
FROM node:alpine
WORKDIR /app
RUN apk add --no-cache openssl
# copy from build image
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/.next ./.next
COPY --from=build /app/public ./public
COPY --from=build /app/tools ./tools
COPY --from=build /app/data ./data
EXPOSE 3000
CMD ["npm","run","start"]