From 7bac268bbb5b502bb3a0ca7ac137703f90f04f71 Mon Sep 17 00:00:00 2001 From: Marcus Ahlfors Date: Wed, 6 Nov 2024 09:49:42 +0200 Subject: [PATCH] Run as node user + monorepo support --- .diploi/helm/app.yaml | 7 ++----- Dockerfile | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.diploi/helm/app.yaml b/.diploi/helm/app.yaml index 40ac71b..71c60e1 100644 --- a/.diploi/helm/app.yaml +++ b/.diploi/helm/app.yaml @@ -30,18 +30,15 @@ spec: terminationGracePeriodSeconds: 10 imagePullSecrets: - name: diploi-pull-secret - # TODO: This should only run once? initContainers: - name: install-dependencies image: ghcr.io/diploi/component-nextjs:main imagePullPolicy: Always command: ['npm', 'install'] - workingDir: /app/nextjs + workingDir: /app/{{ .Values.identifier }} env: - name: NODE_ENV value: development - securityContext: - runAsUser: 0 # Ensure it runs as root volumeMounts: - name: app-mount mountPath: /app @@ -49,7 +46,7 @@ spec: - name: app image: ghcr.io/diploi/component-nextjs:main imagePullPolicy: Always - workingDir: /app/nextjs + workingDir: /app/{{ .Values.identifier }} ports: - containerPort: 3000 {{- if eq .Values.stage "development"}} diff --git a/Dockerfile b/Dockerfile index b30450a..d8cd3bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,7 +63,7 @@ COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static -#USER nextjs +USER node EXPOSE 3000