Skip to content

Commit

Permalink
Configurable build args
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardo-forina committed Apr 3, 2024
1 parent 4f12f52 commit ab7e57b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@ WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

ENV BACKEND_URL http://example
ENV CONSOLE_METRICS_PROMETHEUS_URL http://example
ENV NEXTAUTH_SECRET examplesecret
ENV LOG_LEVEL info
ENV CONSOLE_MODE read-only
ENV NEXT_TELEMETRY_DISABLED 1
ARG backend_url=http://example
ARG console_metrics_prometheus_url=http://example
ARG nextauth_secret=examplesecret
ARG log_level=info
ARG console_mode=read-only

ENV BACKEND_URL=$backend_url
ENV CONSOLE_METRICS_PROMETHEUS_URL=$console_metrics_prometheus_url
ENV NEXTAUTH_SECRET=$nextauth_secret
ENV LOG_LEVEL=$log_level
ENV CONSOLE_MODE=$console_mode

RUN npm run build

FROM registry.access.redhat.com/ubi9/nodejs-18-minimal AS runner
USER 0
WORKDIR /app

ENV NODE_ENV production

COPY --from=builder /app/public ./public
COPY --from=builder --chown=1001:1001 /app/.next/standalone ./
COPY --from=builder --chown=1001:1001 /app/.next/static ./.next/static
Expand All @@ -39,7 +42,7 @@ USER 1001

EXPOSE 3000

ENV NODE_ENV production
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"

CMD ["node", "server.js"]

0 comments on commit ab7e57b

Please sign in to comment.