FROM mcr.microsoft.com/dotnet/sdk:10.0.201-alpine3.23 AS base ARG centron_version ARG centron_git_commit ENV CENTRON_VERSION=$centron_version ENV CENTRON_GIT_COMMIT=$centron_git_commit RUN apk add --no-cache sed RUN mkdir build WORKDIR /build COPY ./ ./ RUN rm -f src/webservice/Centron.Host.Console/app.config RUN ls src/webservice/Centron.Host.Console/ RUN mv src/webservice/Centron.Host.Console/additional.props.docker src/webservice/Centron.Host.Console/additional.props RUN cat Directory.Build.props ### be carefull, the following replacement does not consider the xml structure. It does a stupid search and replace RUN sed -i "s/1.0.0.0<\/Version>/${CENTRON_VERSION}<\/Version>/" ./Directory.Build.props RUN sed -i "s/<\/GitCommitId>/${CENTRON_GIT_COMMIT}<\/GitCommitId>/" ./Directory.Build.props RUN cat Directory.Build.props ARG dx_license RUN mkdir -p $HOME/.config/DevExpress && \ echo "$dx_license" > $HOME/.config/DevExpress/DevExpress_License.txt RUN dotnet publish "./src/webservice/Centron.Host.Console/Centron.Host.Console.csproj" -c release --self-contained true -o ./app ### build finished FROM mcr.microsoft.com/dotnet/runtime:10.0.5-alpine3.23 ARG centron_version ARG centron_git_commit ENV CENTRON_VERSION=$centron_version ENV CENTRON_GIT_COMMIT=$centron_git_commit RUN apk add --no-cache icu-data-full icu-libs RUN apk add --no-cache tzdata RUN apk add --no-cache fontconfig RUN apk add ttf-dejavu && \ apk add msttcorefonts-installer && \ apk add ttf-dejavu && \ update-ms-fonts && \ fc-cache -f RUN ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so && \ ln -s /lib/libuuid.so.1 /usr/lib/libuuid.so.1 && \ ln -s /lib/libc.musl-x86_64.so.1 /usr/lib/libc.musl-x86_64.so.1 ENV LD_LIBRARY_PATH=/usr/lib ENV TZ=Europe/Berlin ENV DOTNET_RUNNING_IN_CONTAINER=true ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false COPY --from=base /build/app /app #RUN /app/Centron.Host.Console configure 1234 'https://api.c-entron.de/' 'Server=docker-centron_db_1; Database=Centron; User Id=SA; Password=SA!password' WORKDIR app