Skip to content

Commit

Permalink
Merge pull request #2 from ateliere-live-public/gui_version_fix_docke…
Browse files Browse the repository at this point in the history
…rfile

Move ARG GUI_VERSION to the layer that uses it
  • Loading branch information
permobergedge committed Aug 28, 2024
2 parents ef9756e + 3db00a7 commit 85ee6d5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ARG GUI_VERSION=dev
FROM node:18-alpine AS base

# Install dependencies only when needed
Expand All @@ -19,14 +18,15 @@ RUN \

# Rebuild the source code only when needed
FROM base AS builder
ARG GUI_VERSION=dev
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_TELEMETRY_DISABLED=1

RUN echo ${GUI_VERSION} > /app/gui-version.txt
RUN npm run build
Expand All @@ -35,9 +35,9 @@ RUN npm run build
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production
ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1
ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
Expand All @@ -49,11 +49,10 @@ COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder /app/gui-version.txt ./

USER nextjs

EXPOSE 3000

ENV PORT 3000
ENV PORT=3000

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

0 comments on commit 85ee6d5

Please sign in to comment.