-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (27 loc) · 1.16 KB
/
Dockerfile
File metadata and controls
30 lines (27 loc) · 1.16 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 | sed 's/-g[a-z0-9]\{7\}//') > /version ;\
echo "Version: "$(cat /version)
FROM mcr.microsoft.com/dotnet/sdk:8.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 -fsSL https://deb.nodesource.com/setup_20.x | bash - &&\
apt-get install -y nodejs
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN sed -i -e "s/<Version>0-develop<\/Version>/<Version>$(cat version | cut -c2- )<\/Version>/g" src/Influunt.Host/Influunt.Host.csproj &&\
dotnet restore -s https://api.nuget.org/v3/index.json &&\
dotnet build --no-restore -c Release &&\
dotnet publish ./src/Influunt.Host/Influunt.Host.csproj -c Release -o /app --no-build &&\
dotnet nuget locals http-cache --clear &&\
dotnet nuget locals temp --clear
######## Influunt Host
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim as influunt
COPY --from=build /app /influunt
WORKDIR /influunt
EXPOSE 80
ENV ASPNETCORE_URLS=http://*:80
ENTRYPOINT ["dotnet", "Influunt.Host.dll"]