From 537c11b2530eac3fd6aba84bc8b35bdb950735f7 Mon Sep 17 00:00:00 2001 From: kirinnee Date: Thu, 26 Oct 2023 00:53:29 +0800 Subject: [PATCH] feat: new migration --- .dockerignore | 4 +++- infra/migrate.Dockerfile | 8 +++++--- infra/root_chart/values.pichu.yaml | 1 + infra/root_chart/values.pikachu.yaml | 1 + infra/root_chart/values.raichu.yaml | 1 + 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index bc108a3..55bc477 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,6 @@ -**/.dockerignore +**/settings.*.yaml +**/settings.yaml +**/.dockerignore **/.env **/.git **/.gitignore diff --git a/infra/migrate.Dockerfile b/infra/migrate.Dockerfile index 28858de..014e6e4 100644 --- a/infra/migrate.Dockerfile +++ b/infra/migrate.Dockerfile @@ -1,9 +1,11 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine +RUN addgroup -g 1000 dotnet && adduser -G dotnet -u 1000 dotnet -D +USER dotnet WORKDIR /app -COPY ["App/App.csproj", "App/"] +COPY --chown=dotnet "App/App.csproj" "App/" RUN dotnet restore "App/App.csproj" -COPY . . +COPY --chown=dotnet . . WORKDIR /app RUN dotnet tool install --global dotnet-ef -ENV PATH="$PATH:/root/.dotnet/tools" +ENV PATH="$PATH:/home/dotnet/.dotnet/tools" CMD [ "dotnet-ef", "database", "update", "--project", "./App" ] diff --git a/infra/root_chart/values.pichu.yaml b/infra/root_chart/values.pichu.yaml index 892a8a6..6e46da5 100644 --- a/infra/root_chart/values.pichu.yaml +++ b/infra/root_chart/values.pichu.yaml @@ -63,6 +63,7 @@ migration: envFromSecret: *target securityContext: *securityContext podSecurityContext: *podSecurityContext + configMountPath: /app/App/Config image: repository: ghcr.io/atomicloud/sulfone.zinc/migrate-amd serviceTree: diff --git a/infra/root_chart/values.pikachu.yaml b/infra/root_chart/values.pikachu.yaml index 1e25925..dc6d940 100644 --- a/infra/root_chart/values.pikachu.yaml +++ b/infra/root_chart/values.pikachu.yaml @@ -67,6 +67,7 @@ migration: envFromSecret: *target securityContext: *securityContext podSecurityContext: *podSecurityContext + configMountPath: /app/App/Config image: repository: ghcr.io/atomicloud/sulfone.zinc/migrate-amd serviceTree: diff --git a/infra/root_chart/values.raichu.yaml b/infra/root_chart/values.raichu.yaml index d1985d5..7b7bcbc 100644 --- a/infra/root_chart/values.raichu.yaml +++ b/infra/root_chart/values.raichu.yaml @@ -68,6 +68,7 @@ migration: envFromSecret: *target securityContext: *securityContext podSecurityContext: *podSecurityContext + configMountPath: /app/App/Config image: repository: ghcr.io/atomicloud/sulfone.zinc/migrate-amd serviceTree: