Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
fix: Replace Harbor images urls by ghcr ones
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-van-woerkens committed Oct 13, 2021
1 parent e7eeb94 commit 4b0c62b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
9 changes: 4 additions & 5 deletions .k8s/components/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import env from "@kosko/env";

import { create } from "@socialgouv/kosko-charts/components/app";
import { getHarborImagePath } from "@socialgouv/kosko-charts/utils/getHarborImagePath";
import environments from '@socialgouv/kosko-charts/environments';

const ciEnv = environments(process.env);

export default create("app", {
env,
Expand All @@ -10,10 +12,7 @@ export default create("app", {
withPostgres: true,
},
deployment: {
image: getHarborImagePath({
project: "sample-next-app",
name: "app",
}),
image: `ghcr.io/socialgouv/sample-next-app/app:sha-${ciEnv.tag || ciEnv.sha}`,
container: {
resources: {
requests: {
Expand Down
9 changes: 4 additions & 5 deletions .k8s/components/hasura.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import env from "@kosko/env";

import { create } from "@socialgouv/kosko-charts/components/hasura";
import { getHarborImagePath } from "@socialgouv/kosko-charts/utils/getHarborImagePath";
import environments from '@socialgouv/kosko-charts/environments';

const ciEnv = environments(process.env);

export default create("hasura", {
env,
deployment: {
image: getHarborImagePath({
project: "sample-next-app",
name: "hasura",
}),
image: `ghcr.io/socialgouv/sample-next-app/hasura:sha-${ciEnv.tag || ciEnv.sha}`,
},
});
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# from https://nextjs.org/docs/deployment

ARG SENTRY_DSN=https://24f5b07f17a544b1b76ac0766ee68020@lafabriquenumerique-sentry.cloud-ed.fr/27

# Install dependencies only when needed
FROM node:14-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
Expand All @@ -14,17 +16,19 @@ WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules

ENV SENTRY_DSN=https://24f5b07f17a544b1b76ac0766ee68020@lafabriquenumerique-sentry.cloud-ed.fr/27
ARG SENTRY_DSN
ENV SENTRY_DSN=$SENTRY_DSN

RUN yarn build && yarn install --production --ignore-scripts --prefer-offline

# Production image, copy all the files and run next
FROM node:14-alpine AS runner
WORKDIR /app

ENV NODE_ENV production
ARG SENTRY_DSN
ENV SENTRY_DSN=$SENTRY_DSN

WORKDIR /app
ENV NODE_ENV production

# You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/next.config.js ./
Expand All @@ -37,4 +41,4 @@ USER node

ENV NEXT_TELEMETRY_DISABLED 1

CMD ["yarn", "start"]
CMD ["yarn", "start"]

0 comments on commit 4b0c62b

Please sign in to comment.