Skip to content

Commit

Permalink
Run as node user + monorepo support
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusAhlfors committed Nov 6, 2024
1 parent 6196c65 commit 7bac268
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions .diploi/helm/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,23 @@ 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
containers:
- 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"}}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static


#USER nextjs
USER node

EXPOSE 3000

Expand Down

0 comments on commit 7bac268

Please sign in to comment.