25 lines
999 B
Docker
25 lines
999 B
Docker
# Standalone P10 host image. The run coordinator supplies SOURCE_REVISION from
|
|
# the current checkout and uses a run-scoped image name in compose.yml.
|
|
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
WORKDIR /src
|
|
COPY . .
|
|
RUN dotnet restore ZB.MOM.WW.OtOpcUa.slnx
|
|
ARG SOURCE_REVISION
|
|
RUN test -n "$SOURCE_REVISION" && dotnet publish \
|
|
src/Server/ZB.MOM.WW.OtOpcUa.Host/ZB.MOM.WW.OtOpcUa.Host.csproj \
|
|
-c Release -o /app --no-restore -p:SourceRevisionId="$SOURCE_REVISION"
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
|
WORKDIR /app
|
|
COPY --from=build /app ./
|
|
EXPOSE 9000 4053 4055 4056 4057 4840 9001
|
|
ENTRYPOINT ["dotnet", "OtOpcUa.Host.dll"]
|
|
|
|
FROM build AS migrator
|
|
RUN dotnet tool install --global dotnet-ef --version 10.0.7
|
|
ENV PATH="${PATH}:/root/.dotnet/tools"
|
|
WORKDIR /src
|
|
ENTRYPOINT ["dotnet", "ef", "database", "update", \
|
|
"--project", "src/Core/ZB.MOM.WW.OtOpcUa.Configuration", \
|
|
"--startup-project", "src/Core/ZB.MOM.WW.OtOpcUa.Configuration"]
|