Skip to content

Commit

Permalink
adjust Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorio-gerardi committed Jan 28, 2025
1 parent d9cfdfd commit 6ecf5b7
Show file tree
Hide file tree
Showing 3 changed files with 1,109 additions and 176 deletions.
34 changes: 4 additions & 30 deletions src/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0


FROM node:20-alpine AS deps
RUN apk add --no-cache libc6-compat

WORKDIR /app

COPY ./src/frontend/package*.json ./
RUN npm ci

FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat protobuf-dev protoc
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY ./pb ./pb
COPY ./src/frontend .

RUN npm run grpc:generate
RUN npm run build
# This dockerfile is tweaked to just push the image. The build should be done locally so it can be copied over to the docker file

FROM node:20-alpine AS runner
WORKDIR /app
RUN apk add --no-cache protobuf-dev protoc

ENV NODE_ENV=production

RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/utils/telemetry/Instrumentation.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=deps /app/node_modules ./node_modules

COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY . .
COPY --chown=nextjs:nodejs ./.next/standalone ./
COPY --chown=nextjs:nodejs ./.next/static ./.next/static

USER nextjs

Expand Down
Loading

0 comments on commit 6ecf5b7

Please sign in to comment.