waterwolf-auth/Dockerfile

25 lines
796 B
Text
Raw Permalink Normal View History

FROM node:22-alpine AS base
2024-11-22 21:25:20 -05:00
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
2024-11-22 21:25:20 -05:00
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
2024-11-22 23:17:50 -05:00
FROM base AS builder-frontend
COPY --from=deps /usr/src/app /usr/src/app
RUN pnpm deploy --target frontend
2024-11-22 23:17:50 -05:00
2024-11-22 21:25:20 -05:00
FROM node:22-alpine AS frontend
2024-11-22 23:17:50 -05:00
WORKDIR /app
COPY --from=base-build /prod/frontend/.next ./.next
COPY --from=base-build /usr/src/app/apps/frontend/public ./.next/standalone/public
2024-11-22 23:17:50 -05:00
ENV NODE_ENV=production
2024-11-22 21:25:20 -05:00
EXPOSE 3000
CMD ["node", ".next/standalone/server.js"]