tcc/ASP.NET/Dockerfile

33 lines
909 B
Docker

FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build-env
WORKDIR /App
# Copy everything
RUN apt update && apt install wget -y
COPY * .
# Restore as distinct layers
RUN dotnet restore
# Build a release
RUN dotnet build -c Release -o out
RUN cd out && \
wget https://files.ivanch.me/api/public/dl/ch3NV0P8/small-image.png && \
wget https://files.ivanch.me/api/public/dl/jNlXYMLR/big-image.png && \
wget https://files.ivanch.me/api/public/dl/QdKvaeQI/video.mp4 && \
wget https://files.ivanch.me/api/public/dl/YD4vmSsO/nginx.html && \
rm -rf runtimes && \
mkdir -p ./static && \
mv small-image.png ./static && \
mv big-image.png ./static && \
mv video.mp4 ./static && \
mv nginx.html ./static
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim
WORKDIR /App
COPY --from=build-env /App/out .
ENTRYPOINT ["dotnet", "/App/TCC.APP.dll"]