-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (28 loc) · 1.17 KB
/
Dockerfile
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
41
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
WORKDIR /src
COPY --link DesktopRepositoryServer/*.csproj DesktopRepositoryServer/
RUN dotnet restore DesktopRepositoryServer/DesktopRepositoryServer.csproj
COPY --link DesktopRepositoryServer/. DesktopRepositoryServer/
# test-build builds the xUnit test project
FROM build AS test-build
COPY --link DesktopRepositoryServer.Tests/*.csproj tests/
WORKDIR /src/tests
RUN dotnet restore
COPY --link DesktopRepositoryServer.Tests/ .
RUN dotnet build --no-restore
# test-entrypoint exposes tests as the default executable for the stage
FROM test-build AS test
ENTRYPOINT ["dotnet", "test", "--no-build", "--logger:trx"]
# publish builds and publishes complexapp
FROM build AS publish
WORKDIR /src/DesktopRepositoryServer
RUN dotnet publish --no-restore -o /app
# final is the final runtime stage for running the app
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final
WORKDIR /app
COPY --link --from=publish /app .
COPY appsettings.Container.json /app/appsettings.Container.json
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN apk update && apk add --no-cache openssl
ENTRYPOINT ["/bin/ash", "/entrypoint.sh"]