Skip to content

Commit

Permalink
[skip ci] wip
Browse files Browse the repository at this point in the history
  • Loading branch information
matmut7 committed Jun 7, 2024
1 parent 559ae06 commit 2c8ed44
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
32 changes: 20 additions & 12 deletions .kontinuous/env/dev/values.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
api:
cmd: true
args:
- sh
- -c
- "yarn strapi import -f ../seed-data.tar.gz && yarn start"
preDeploy:
cleaner:
match:
kind: Deployment
value: true
- "yarn strapi import --force -f seed-data.tar.gz && yarn start"
~preDeploy.cleaner:
match:
kind: Deployment
value: true

pg:
preDeploy:
cleaner:
match:
kind: clusters.postgresql.cnpg.io
value: true
# Strapi wants to move the entire uploads dir to a backup when you import data
# so public cannot be a volume, it must be its parent
# see https://github.com/strapi/strapi/issues/17809
initContainers:
- name: move-public-to-volume
image:
"{{ .Values.global.registry }}/{{ .Values.global.projectName }}/{{
.Values.global.imageRepository }}/api:{{ .Values.global.imageTag }}"
command: ["/bin/sh", "-c"]
args:
- cp -r public/* /mnt/public;
volumeMounts:
- name: public
mountPath: /mnt/public
12 changes: 8 additions & 4 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ api:
HOST: "0.0.0.0"
PORT: "1337"
DATABASE_CLIENT: postgres
replicas: 1 # mandatory because volume is RWO
strategyType: Recreate # idem
securityContext:
fsGroup: 1000
volumes:
- name: uploads
emptyDir: {}
- name: public
volumeMounts:
- mountPath: /app/public/uploads
name: uploads
- mountPath: /app/public
name: public

jobs:
runs:
build-next-app:
use: build
~needs: ["api"]
with:
context: ./next-app
imagePackage: next-app
Expand Down
3 changes: 3 additions & 0 deletions next-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ENV NEXT_PUBLIC_MATOMO_SITE_ID="34"
ENV NEXT_PUBLIC_MATOMO_URL="https://matomo.fabrique.social.gouv.fr/"
ENV NODE_ENV=production

ARG NEXT_PUBLIC_STRAPI_API_URL
ENV NEXT_PUBLIC_STRAPI_API_URL $NEXT_PUBLIC_STRAPI_API_URL

RUN yarn build

FROM node:20 as runner
Expand Down
2 changes: 1 addition & 1 deletion next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"dev": "next dev",
"start": "next start",
"build": "next build --experimental-build-mode compile",
"build": "next build",
"lint": "eslint .",
"k8s": "yarn --silent --cwd .k8s",
"predev": "only-include-used-icons",
Expand Down

0 comments on commit 2c8ed44

Please sign in to comment.