Skip to content

Commit

Permalink
Add runtime and buildtime args
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismaaa committed Nov 6, 2024
1 parent 86f4333 commit d5b7882
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ FROM node:18-alpine AS builder

WORKDIR /app

ARG NEXT_PUBLIC_SUPABASE_URL
ARG NEXT_PUBLIC_SUPABASE_ANON_KEY

# Build-time environment variables
ENV NEXT_TELEMETRY_DISABLED=1 \
NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL \
NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY

COPY package.json package-lock.json ./

RUN npm ci
Expand All @@ -18,8 +26,11 @@ FROM node:18-alpine AS runner

WORKDIR /app

# Run-time environment variables
ENV NODE_ENV=production \
NEXT_TELEMETRY_DISABLED=1
NEXT_TELEMETRY_DISABLED=1 \
NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL \
NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY

COPY --from=builder /app/next.config.mjs ./
COPY --from=builder /app/public ./public
Expand Down

0 comments on commit d5b7882

Please sign in to comment.