wip
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# ---- build ----
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ROLAC.API/ROLAC.API.csproj ROLAC.API/
|
||||
RUN dotnet restore ROLAC.API/ROLAC.API.csproj
|
||||
COPY ROLAC.API/ ROLAC.API/
|
||||
RUN dotnet publish ROLAC.API/ROLAC.API.csproj -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
# ---- runtime ----
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
|
||||
WORKDIR /app
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production \
|
||||
ASPNETCORE_HTTP_PORTS=8080
|
||||
# curl: used by the HEALTHCHECK (not present in the base image)
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=build /app/publish .
|
||||
# storage dir created + owned for the non-root app user
|
||||
RUN mkdir -p /app/App_Data/storage && chown -R app:app /app/App_Data
|
||||
USER app
|
||||
EXPOSE 8080
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s \
|
||||
CMD curl -fsS http://localhost:8080/health || exit 1
|
||||
ENTRYPOINT ["dotnet", "ROLAC.API.dll"]
|
||||
Reference in New Issue
Block a user