-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (20 loc) · 754 Bytes
/
Dockerfile
File metadata and controls
26 lines (20 loc) · 754 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
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
WORKDIR /app
EXPOSE 80
COPY YelpRandomFood/*.csproj YelpRandomFood/
COPY YelpRestaurantFinderComponent/*.csproj YelpRestaurantFinderComponent/
COPY *.sln .
FROM build-env AS restore
RUN dotnet restore YelpRandomRestaurantFinder.sln
FROM restore AS src
COPY . .
FROM src AS build
RUN dotnet publish -c Release -o out YelpRandomRestaurantFinder.sln
FROM mcr.microsoft.com/dotnet/aspnet:latest
WORKDIR /app
COPY --from=build /app/out .
RUN apt update
RUN apt install --yes curl
HEALTHCHECK --interval=5m --timeout=10s --start-period=1s --retries=3 \
CMD curl --fail http://localhost/healthcheck | grep -E '^{\"status\":\"Healthy\",' || exit 1
ENTRYPOINT ["dotnet", "YelpRandomRestaurantFinder.dll"]