3
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 19s
Docker Build & Deploy / Deploy to Production (push) Successful in 4s

This commit is contained in:
孙诚
2025-03-06 17:43:46 +08:00
parent eadb57eff7
commit 1c7dfe01d2

View File

@@ -5,6 +5,13 @@ EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
# 创建与宿主机匹配的 UID/GID
ARG TARGET_UID=1000
ARG TARGET_GID=1000
RUN groupadd -g $TARGET_GID appuser && \
useradd -u $TARGET_UID -g $TARGET_GID -d /app -s /bin/bash appuser
ARG BUILD_CONFIGURATION=Release ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
COPY ["src/Core/Core.csproj", "src/Core/"] COPY ["src/Core/Core.csproj", "src/Core/"]