7
All checks were successful
Deploy Frontend / deploy (push) Successful in 1m34s

This commit is contained in:
Lee 2024-10-04 17:46:38 +01:00
parent b1656b2858
commit f8a6bccf14

View File

@ -1,20 +1,37 @@
FROM fascinated/docker-images:nodejs_20_with_pnpm AS base
FROM base AS builder
RUN apk update
RUN apk add --no-cache libc6-compat
# Set working directory
WORKDIR /app
RUN pnpm i -g turbo@^2
COPY . .
RUN turbo prune frontend --docker
FROM base AS installer
WORKDIR /app
COPY . .
RUN pnpm install
ENV NEXT_TELEMETRY_DISABLED 1
# Add the commit hash
ARG GIT_REV
ENV GIT_REV=${GIT_REV}
# Add the sentry auth token
ARG SENTRY_AUTH_TOKEN
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
RUN pnpm i -g turbo@^2
RUN turbo prune frontend --docker
RUN turbo run build --filter=frontend
# First install the dependencies (as they change less often)
COPY --from=builder /app/out/json/ .
RUN pnpm install
# Build the project
COPY --from=builder /app/out/full/ .
RUN pnpm turbo run build --filter=frontend
FROM base AS runner
@ -33,7 +50,6 @@ USER nextjs
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/frontend/node_modules ./apps/frontend/node_modules
COPY --from=installer --chown=nextjs:nodejs /app/apps/frontend/.next/standalone ./apps/frontend
COPY --from=installer --chown=nextjs:nodejs /app/apps/frontend/.next/static ./apps/frontend/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/frontend/public ./apps/frontend/public