Skip to content

Commit

Permalink
👷 Distroless image + docker config updater + PR build workflow (#166)
Browse files Browse the repository at this point in the history
* 👷 distroless image og docker config updater

* 👷 bygg pull requester
  • Loading branch information
tidnav authored Oct 31, 2024
1 parent 747b5ae commit a519db3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build pull request

on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**.md'

jobs:
buildDev:
uses: navikt/aap-workflows/.github/workflows/frontend-next-only-build.yml@main
permissions:
contents: read
id-token: write
packages: write
secrets: inherit
with:
cluster: dev-gcp
15 changes: 15 additions & 0 deletions .github/workflows/update-dependabot-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Update dependabot config

on:
workflow_dispatch:
schedule:
- cron: '0 7 * * 3'

jobs:
checkForConfigUpdate:
uses: navikt/aap-workflows/.github/workflows/dependabot-frontend-next-config-updater.yml@main
permissions:
contents: write
id-token: write
packages: write
pull-requests: write
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
FROM node:20-alpine
FROM gcr.io/distroless/nodejs20-debian12@sha256:f912a7599e5338df6527a669def29bddc9469fdac9ab22c4cc9282c1b64c868b

ENV NODE_ENV production

RUN addgroup --system --gid 1069 nodejs
RUN adduser --system --uid 1069 nextjs

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

USER nextjs
ENV NODE_ENV production

Check warning on line 8 in Dockerfile

View workflow job for this annotation

GitHub Actions / buildDev / build

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 8 in Dockerfile

View workflow job for this annotation

GitHub Actions / buildProd / build

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

EXPOSE 3000

ENV PORT 3000

Check warning on line 12 in Dockerfile

View workflow job for this annotation

GitHub Actions / buildDev / build

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

Check warning on line 12 in Dockerfile

View workflow job for this annotation

GitHub Actions / buildProd / build

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

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

0 comments on commit a519db3

Please sign in to comment.