@@ -28,15 +28,13 @@ ARG GIT_ASSEMBLY_VERSION
2828ARG GIT_FILE_VERSION
2929WORKDIR /src
3030
31- # Copy configuration files
3231COPY ["openalprwebhookprocessor.client/angular.json" , \
3332 "openalprwebhookprocessor.client/tsconfig*.json" , \
3433 "openalprwebhookprocessor.client/karma.conf.js" , \
3534 "openalprwebhookprocessor.client/eslint.config.mjs" , \
3635 "openalprwebhookprocessor.client/ngsw-config.json" , \
3736 "openalprwebhookprocessor.client/" ]
3837
39- # Copy source code (changes most frequently)
4038COPY ["OpenAlprWebhookProcessor.Server/" , "OpenAlprWebhookProcessor.Server/" ]
4139COPY ["openalprwebhookprocessor.client/src/" , "openalprwebhookprocessor.client/src/" ]
4240
@@ -47,22 +45,18 @@ RUN dotnet build "./OpenAlprWebhookProcessor.Server.csproj" -c $BUILD_CONFIGURAT
4745 -p:GitAssemblyVersion="$GIT_ASSEMBLY_VERSION" \
4846 -p:GitFileVersion="$GIT_FILE_VERSION" && \
4947 mkdir -p /app/build && \
50- /root/.dotnet/tools/dotnet-ef migrations bundle \
48+ /root/.dotnet/tools/dotnet-ef migrations script \
5149 --project "./OpenAlprWebhookProcessor.Server.csproj" \
5250 --startup-project "./OpenAlprWebhookProcessor.Server.csproj" \
5351 --context ProcessorContext \
54- --output /app/build/processor-migrator \
55- --configuration $BUILD_CONFIGURATION \
56- --verbose \
57- --force && \
58- /root/.dotnet/tools/dotnet-ef migrations bundle \
52+ --output /app/build/processor-migrations.sql \
53+ --configuration $BUILD_CONFIGURATION && \
54+ /root/.dotnet/tools/dotnet-ef migrations script \
5955 --project "./OpenAlprWebhookProcessor.Server.csproj" \
6056 --startup-project "./OpenAlprWebhookProcessor.Server.csproj" \
6157 --context UsersContext \
62- --output /app/build/users-migrator \
63- --configuration $BUILD_CONFIGURATION \
64- --verbose \
65- --force
58+ --output /app/build/users-migrations.sql \
59+ --configuration $BUILD_CONFIGURATION
6660
6761FROM build AS publish
6862ARG BUILD_CONFIGURATION
@@ -72,6 +66,7 @@ ARG GIT_FILE_VERSION
7266RUN dotnet publish "./OpenAlprWebhookProcessor.Server.csproj" \
7367 -c $BUILD_CONFIGURATION \
7468 -o /app/publish \
69+ -r linux-musl-x64 \
7570 /p:UseAppHost=false \
7671 /p:PublishSingleFile=false \
7772 -p:GitVersion="$GIT_VERSION" \
@@ -81,9 +76,12 @@ RUN dotnet publish "./OpenAlprWebhookProcessor.Server.csproj" \
8176FROM base AS final
8277WORKDIR /app
8378
79+ USER root
80+ RUN apk add --no-cache sqlite
81+
8482COPY --from=publish /app/publish .
85- COPY --from=build /app/build/processor-migrator ./processor-migrator
86- COPY --from=build /app/build/users-migrator ./users-migrator
83+ COPY --from=build /app/build/processor-migrations.sql ./processor-migrations.sql
84+ COPY --from=build /app/build/users-migrations.sql ./users-migrations.sql
8785COPY --from=build /src/OpenAlprWebhookProcessor.Server/scripts/entrypoint.sh ./
8886
8987USER root
0 commit comments