-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-backoffice
40 lines (37 loc) · 3.7 KB
/
Dockerfile-backoffice
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /app
# Allow results of `dotnet restore` to be cached if there are no changes to dependencies.
COPY ./NuGet.config /app/NuGet.config
RUN --mount=type=cache,target=/dotnet/packages \
--mount=type=cache,target=/dotnet/global-packages \
--mount=type=bind,source=./ef-app_backend-dotnet-core.sln,target=/app/ef-app_backend-dotnet-core.sln \
--mount=type=bind,source=./src/Eurofurence.App.Common/Eurofurence.App.Common.csproj,target=/app/src/Eurofurence.App.Common/Eurofurence.App.Common.csproj \
--mount=type=bind,source=./src/Eurofurence.App.Tools.CliToolBox/Eurofurence.App.Tools.CliToolBox.csproj,target=/app/src/Eurofurence.App.Tools.CliToolBox/Eurofurence.App.Tools.CliToolBox.csproj \
--mount=type=bind,source=./src/Eurofurence.App.Server.Services/Eurofurence.App.Server.Services.csproj,target=/app/src/Eurofurence.App.Server.Services/Eurofurence.App.Server.Services.csproj \
--mount=type=bind,source=./src/Eurofurence.App.Server.Web/Eurofurence.App.Server.Web.csproj,target=/app/src/Eurofurence.App.Server.Web/Eurofurence.App.Server.Web.csproj \
--mount=type=bind,source=./src/Eurofurence.App.Backoffice/Eurofurence.App.Backoffice.csproj,target=/app/src/Eurofurence.App.Backoffice/Eurofurence.App.Backoffice.csproj \
--mount=type=bind,source=./src/Eurofurence.App.Infrastructure.EntityFramework/Eurofurence.App.Infrastructure.EntityFramework.csproj,target=/app/src/Eurofurence.App.Infrastructure.EntityFramework/Eurofurence.App.Infrastructure.EntityFramework.csproj \
--mount=type=bind,source=./src/Eurofurence.App.Domain.Model/Eurofurence.App.Domain.Model.csproj,target=/app/src/Eurofurence.App.Domain.Model/Eurofurence.App.Domain.Model.csproj \
--mount=type=bind,source=./test/Eurofurence.App.Server.Services.Tests/Eurofurence.App.Server.Services.Tests.csproj,target=/app/test/Eurofurence.App.Server.Services.Tests/Eurofurence.App.Server.Services.Tests.csproj \
--mount=type=bind,source=./test/Eurofurence.App.Server.Web.Tests/Eurofurence.App.Server.Web.Tests.csproj,target=/app/test/Eurofurence.App.Server.Web.Tests/Eurofurence.App.Server.Web.Tests.csproj \
--mount=type=bind,source=./test/Eurofurence.App.Tests.Common/Eurofurence.App.Tests.Common.csproj,target=/app/test/Eurofurence.App.Tests.Common/Eurofurence.App.Tests.Common.csproj \
dotnet nuget config set repositoryPath /dotnet/packages --configfile /app/NuGet.config \
&& dotnet nuget config set globalPackagesFolder /dotnet/global-packages --configfile /app/NuGet.config \
&& dotnet restore
COPY ./src/ /app/src/
COPY ./test/ /app/test/
RUN --mount=type=cache,target=/dotnet/packages \
--mount=type=cache,target=/dotnet/global-packages \
--mount=type=cache,target=/dotnet/artifacts \
--mount=type=bind,source=./ef-app_backend-dotnet-core.sln,target=/app/ef-app_backend-dotnet-core.sln \
touch src/Eurofurence.App.Backoffice/wwwroot/appsettings.json \
&& dotnet build src/Eurofurence.App.Backoffice/Eurofurence.App.Backoffice.csproj --artifacts-path /dotnet/artifacts --configuration Release \
&& dotnet publish src/Eurofurence.App.Backoffice/Eurofurence.App.Backoffice.csproj --artifacts-path /dotnet/artifacts --no-build --output "/app/backoffice" --configuration Release
ENTRYPOINT dotnet artifacts/Eurofurence.App.Backoffice.dll http://*:30002
EXPOSE 30002
FROM nginx:1.27
ENV BACKOFFICE_BASE_PATH=
COPY --from=build /app/backoffice/wwwroot/ /usr/share/nginx/html/
COPY ./docker/nginx/etc/ /etc/
COPY ./docker/nginx/docker-entrypoint.d/ /docker-entrypoint.d/
RUN openssl req -x509 -nodes -days 365 -subj "/C=DE/ST=HH/O=EF Development/CN=ef.example.com" -addext "subjectAltName=DNS:ef.example.com" -newkey rsa:2048 -keyout /etc/ssl/private/nginx.key -out /etc/ssl/certs/nginx.crt