-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
32 lines (24 loc) · 859 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
26
27
28
29
30
31
32
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /build
COPY vendor ./vendor
COPY fodinfo.sln ./
COPY src/fodinfo.fsproj ./src/
RUN dotnet restore
COPY . .
RUN dotnet publish -c release -o /app --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
EXPOSE 5000
ENV ASPNETCORE_URLS=http://+:5000
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
# For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
RUN adduser -u 5678 --disabled-password --gecos "" appuser \
&& chown -R appuser /app
RUN mkdir /data && chown -R appuser /data
USER appuser
VOLUME [ "/data" ]
COPY --from=build /app .
ENTRYPOINT ["dotnet", "fodinfo.dll"]
HEALTHCHECK \
--interval=5s --timeout=10s --start-period=5s --retries=3 \
CMD [ "curl --fail http://localhost:8080/healthz" ]