-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 1.01 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
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG TARGETARCH
ARG VERSION=0.0.1
RUN apt update && \
apt install -y ca-certificates curl gnupg2
RUN curl -sL https://sentry.io/get-cli/ | sh
COPY "src/Net.Vatprc.Uniapi.csproj" "/src/"
COPY "src/packages.lock.json" "/src/"
WORKDIR "/src/"
RUN dotnet restore --locked-mode -a $TARGETARCH
COPY "src/" "/src/"
RUN sed -i "s|<AssemblyVersion>0.0.1</AssemblyVersion>|<AssemblyVersion>${VERSION}</AssemblyVersion>|g" "/src/Net.Vatprc.Uniapi.csproj"
ENV SENTRY_RELEASE=Net.Vatprc.Uniapi@${VERSION}
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN,env=SENTRY_AUTH_TOKEN \
dotnet build -c Release --no-self-contained --no-restore -a $TARGETARCH
RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN,env=SENTRY_AUTH_TOKEN \
dotnet publish -c Release -o /app/publish --no-self-contained --no-restore -a $TARGETARCH
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
EXPOSE 5000
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "Net.Vatprc.Uniapi.dll"]