-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (26 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
30 lines (26 loc) · 1.08 KB
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
FROM alpine/git as version
WORKDIR /src
COPY . /src
RUN echo $(git describe --tags --always 2>/dev/null | cut -d '-' -f 1,2) > /version
RUN echo "Computed version `cat /version`"
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
COPY . /build
COPY --from=version /version /build/version
WORKDIR /build
RUN apt-get update -yq ;\
apt-get install curl gnupg -yq ;\
curl -sL https://deb.nodesource.com/setup_20.x | bash - ;\
apt-get install -y nodejs
RUN sed -i -e "s/<Version>0-develop<\/Version>/<Version>$(cat version | cut -c2- )<\/Version>/g" src/Heimdallr.Host/Heimdallr.Host.csproj;\
dotnet restore -s https://api.nuget.org/v3/index.json; \
dotnet build --no-restore -c Release; \
dotnet publish ./src/Heimdallr.Host/Heimdallr.Host.csproj -c Release -o /app --no-build; \
dotnet nuget locals http-cache --clear;\
dotnet nuget locals temp --clear
######## Heimdallr Host
FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim as Heimdallr
COPY --from=build /app /Heimdallr
WORKDIR /Heimdallr
EXPOSE 80
ENV ASPNETCORE_URLS=http://*:80
ENTRYPOINT ["dotnet", "Heimdallr.Host.dll"]