diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f9fd026..77df8b2 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -12,11 +12,13 @@ WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . ./ -# Allows configuring the API URL at build time. +# Allows configuring the API URL and auth at build time. ARG NEXT_PUBLIC_API_URL=auto ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} ARG NEXT_PUBLIC_AUTH_MODE ENV NEXT_PUBLIC_AUTH_MODE=${NEXT_PUBLIC_AUTH_MODE} +ARG NEXT_PUBLIC_LOCAL_AUTH_TOKEN +ENV NEXT_PUBLIC_LOCAL_AUTH_TOKEN=${NEXT_PUBLIC_LOCAL_AUTH_TOKEN} RUN npm run build @@ -25,11 +27,13 @@ WORKDIR /app ENV NODE_ENV=production ARG NEXT_PUBLIC_AUTH_MODE +ARG NEXT_PUBLIC_LOCAL_AUTH_TOKEN # If provided at runtime, Next will expose NEXT_PUBLIC_* to the browser as well # (but note some values may be baked at build time). ENV NEXT_PUBLIC_API_URL=auto ENV NEXT_PUBLIC_AUTH_MODE=${NEXT_PUBLIC_AUTH_MODE} +ENV NEXT_PUBLIC_LOCAL_AUTH_TOKEN=${NEXT_PUBLIC_LOCAL_AUTH_TOKEN} # Create non-root user before COPY so --chown can reference it. RUN addgroup -S appgroup && adduser -S -G appgroup appuser