Skip to content

Commit

Permalink
fix(build): allow the ANALYTICS_DOMAIN to be customized during the Do…
Browse files Browse the repository at this point in the history
…cker build
  • Loading branch information
recurser committed Nov 6, 2023
1 parent 5cc0bda commit ec798fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install dependencies only when needed
FROM --platform=$BUILDPLATFORM node:18-alpine AS deps
FROM --platform=$BUILDPLATFORM node:20-alpine 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
Expand All @@ -8,21 +8,21 @@ COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Rebuild the source code only when needed
FROM --platform=$BUILDPLATFORM node:18-alpine AS builder
FROM --platform=$BUILDPLATFORM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

ARG ANALYTICS_DOMAIN=string.is
ENV NEXT_PUBLIC_ANALYTICS_DOMAIN $ANALYTICS_DOMAIN
ENV NEXT_TELEMETRY_DISABLED 1
ENV OUTPUT_STANDALONE 1
RUN yarn build

# Production image, copy all the files and run next
FROM --platform=$BUILDPLATFORM node:18-alpine AS runner
FROM --platform=$BUILDPLATFORM node:20-alpine AS runner
WORKDIR /app

ARG ANALYTICS_DOMAIN=string.is
ENV NEXT_PUBLIC_ANALYTICS_DOMAIN $ANALYTICS_DOMAIN
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 0

Expand Down

0 comments on commit ec798fb

Please sign in to comment.