-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (25 loc) · 969 Bytes
/
Dockerfile
File metadata and controls
30 lines (25 loc) · 969 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
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
RUN apt-get update && apt-get install -y curl \
&& curl -Ls https://cli.doppler.com/install.sh | sh
WORKDIR /src
COPY ["AurionCal.Api.csproj", "./"]
RUN dotnet restore "AurionCal.Api.csproj"
COPY . .
WORKDIR "/src/"
RUN dotnet build "./AurionCal.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./AurionCal.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=build /usr/bin/doppler /usr/bin/doppler
COPY --from=publish /app/publish .
# Les templates Razor/MJML doivent être présents au runtime (RazorLight FileSystemProject)
COPY --from=build /src/Templates ./Templates
ENTRYPOINT ["doppler", "run", "--", "dotnet", "AurionCal.Api.dll"]