-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
25 lines (20 loc) · 957 Bytes
/
Dockerfile
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
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["AdLerBackend.API/AdLerBackend.API.csproj", "AdLerBackend.API/"]
COPY ["AdLerBackend.Application/AdLerBackend.Application.csproj", "AdLerBackend.Application/"]
COPY ["AdLerBackend.Domain/AdLerBackend.Domain.csproj", "AdLerBackend.Domain/"]
COPY ["AdLerBackend.Infrastructure/AdLerBackend.Infrastructure.csproj", "AdLerBackend.Infrastructure/"]
RUN dotnet restore "AdLerBackend.API/AdLerBackend.API.csproj"
COPY . .
WORKDIR "/src/AdLerBackend.API"
RUN dotnet publish "AdLerBackend.API.csproj" -c Release -o /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
# Install curl and clean up
RUN apt-get update && apt-get install -y curl && \
apt-get clean && rm -rf /var/lib/apt/lists/*
HEALTHCHECK --start-period=30s CMD curl -f http://localhost/api/health || exit 1
COPY --from=build /app/publish .
CMD ["dotnet", "AdLerBackend.API.dll"]