From 9eaec6f836cfd47171ecc005dcd1b4ca9ed914a5 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Mon, 31 Jul 2023 14:03:26 +0200 Subject: [PATCH 1/2] Helm file and container for Leiden --- .env | 2 +- Dockerfile | 3 +++ docker-compose.yml | 2 ++ .../huwelijksplanner/templates/configmap.yaml | 7 ------- .../templates/deployment.yaml | 19 ------------------- helm/huwelijksplanner/templates/secrets.yaml | 7 ------- helm/huwelijksplanner/templates/service.yaml | 14 ++++++++++++++ 7 files changed, 20 insertions(+), 34 deletions(-) delete mode 100644 helm/huwelijksplanner/templates/configmap.yaml delete mode 100644 helm/huwelijksplanner/templates/secrets.yaml create mode 100644 helm/huwelijksplanner/templates/service.yaml diff --git a/.env b/.env index db3a6274..60c619f7 100644 --- a/.env +++ b/.env @@ -6,6 +6,6 @@ NPM_REGISTRY= NPM_TOKEN= VCS_REF= VERSION= -NEXT_PUBLIC_API_URL=https://api.huwelijksplanner.online/api +NEXT_PUBLIC_API_URL=https://api.leiden-hp.commonground.nu/api NEXT_PUBLIC_MATOMO_URL=https://stats.utrecht.nl/analytics/ NEXT_PUBLIC_MATOMO_SITE_ID=5 diff --git a/Dockerfile b/Dockerfile index 6a637f9b..5004c307 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,9 @@ ARG NODE_ENV ARG NPM_REGISTRY ARG NPM_STRICT_SSL ARG NPM_TOKEN +ARG NEXT_PUBLIC_API_URL + +RUN echo $NEXT_PUBLIC_API_URL RUN if test "$NODE_ENV" = 'development'; \ then \ diff --git a/docker-compose.yml b/docker-compose.yml index 46085875..85482aaf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,8 +13,10 @@ services: - "NPM_TOKEN=${NPM_TOKEN}" - "VCS_REF=${VCS_REF}" - "VERSION=${VERSION}" + - "NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}" context: . dockerfile: ./Dockerfile ports: - "3000:3000" command: "start" + image: ghcr.io/conductionnl/huwelijksplanner-utrecht:leiden diff --git a/helm/huwelijksplanner/templates/configmap.yaml b/helm/huwelijksplanner/templates/configmap.yaml deleted file mode 100644 index 1a7a0ef4..00000000 --- a/helm/huwelijksplanner/templates/configmap.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "api-platform.fullname" . }} - labels: - {{- include "api-platform.labels" . | nindent 4 }} -data: [] \ No newline at end of file diff --git a/helm/huwelijksplanner/templates/deployment.yaml b/helm/huwelijksplanner/templates/deployment.yaml index 1ca740cc..3c52fbc5 100644 --- a/helm/huwelijksplanner/templates/deployment.yaml +++ b/helm/huwelijksplanner/templates/deployment.yaml @@ -29,17 +29,6 @@ spec: {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - volumes: - - name: tmpfs - emptyDir: {} - - name: tmpfs2 - emptyDir: {} - - name: env - configMap: - name: {{ include "api-platform.fullname" . }} - items: - - key: "properties" - path: "env.js" containers: - name: {{ .Chart.Name }}-pwa @@ -47,14 +36,6 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.pwa.image.image }}:{{ .Values.pwa.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.pwa.image.pullPolicy }} - volumeMounts: - - name: env - mountPath: "/usr/share/nginx/html/env.js" - subPath: "env.js" - - mountPath: /var/cache/nginx/client_temp - name: tmpfs - - mountPath: /var/run - name: tmpfs2 ports: - name: http containerPort: 3000 diff --git a/helm/huwelijksplanner/templates/secrets.yaml b/helm/huwelijksplanner/templates/secrets.yaml deleted file mode 100644 index 577923f6..00000000 --- a/helm/huwelijksplanner/templates/secrets.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "api-platform.fullname" . }} - labels: - {{- include "api-platform.labels" . | nindent 4 }} -type: Opaque diff --git a/helm/huwelijksplanner/templates/service.yaml b/helm/huwelijksplanner/templates/service.yaml new file mode 100644 index 00000000..04ba5263 --- /dev/null +++ b/helm/huwelijksplanner/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "api-platform.fullname" . }} + labels: + {{- include "api-platform.labelsPWA" . | nindent 4 }} +spec: + ports: + - port: 80 + targetPort: 3000 + protocol: TCP + name: http + selector: + {{- include "api-platform.selectorLabelsPWA" . | nindent 4 }} From 40a2e54e4323b20e17e3bc5c0523f27e5018c350 Mon Sep 17 00:00:00 2001 From: Sarai Misidjan Date: Mon, 31 Jul 2023 14:51:33 +0200 Subject: [PATCH 2/2] small fix dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5004c307..86c3fd31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ ADD ./ /var/www/ RUN if test "$NODE_ENV" != 'development'; \ then \ npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" \ - && NODE_ENV=development npm ci --no-update-notifier \ + && NODE_ENV=development && npm ci --no-update-notifier \ && npm run build \ && npm prune \ && npm config set "//registry.npmjs.org/:_authToken" "" \