-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
38 lines (25 loc) · 959 Bytes
/
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
# syntax=docker/dockerfile:1.5
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ./src/Server/**/*.csproj ./proj/
# https://github.com/moby/moby/issues/15858#issuecomment-735490068
RUN for file in $(ls ./proj); do mkdir /src/${file%.*} && mv ./proj/${file} /src/${file%.*}/${file}; done
RUN dotnet restore "EventBusExplorer.Server.API/EventBusExplorer.Server.API.csproj"
COPY ./src/Server/ .
COPY --link ./.editorconfig .
WORKDIR /src/EventBusExplorer.Server.API
RUN dotnet build "EventBusExplorer.Server.API.csproj" \
--configuration Release \
--no-restore \
--no-self-contained
RUN dotnet publish "EventBusExplorer.Server.API.csproj" \
--configuration Release \
--no-restore \
--no-build \
--no-self-contained \
--output /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim AS final
WORKDIR /app
COPY --from=build /app/publish .
EXPOSE 80
ENTRYPOINT [ "dotnet", "EventBusExplorer.Server.API.dll" ]