-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 772 Bytes
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 772 Bytes
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
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal AS base
LABEL org.opencontainers.image.source https://github.com/tipcat-net/tipcat-net-api
ARG VAULT_TOKEN
ENV TCDN_VAULT_TOKEN=$VAULT_TOKEN
RUN apt update && apt install -y \
libgdiplus \
libc6-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
ARG GITHUB_TOKEN
WORKDIR /src
COPY *.sln ./
COPY . .
RUN dotnet restore
WORKDIR /src/TipCatDotNet.Api
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
HEALTHCHECK --interval=6s --timeout=10s --retries=3 CMD curl -sS 127.0.0.1/health || exit 1
ENTRYPOINT ["dotnet", "TipCatDotNet.Api.dll"]