123456789101112131415161718192021222324252627282930313233343536 |
- #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
- FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
- WORKDIR /app
- EXPOSE 80
- EXPOSE 443
- RUN apt-get update \
- && apt-get install -y --no-install-recommends dialog \
- && apt-get install -y --no-install-recommends openssh-server \
- && apt-get install -y tcpdump\
- && mkdir -p /run/sshd \
- && echo "root:Docker!" | chpasswd
-
- COPY sshd_config /etc/ssh/sshd_config
- FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
- WORKDIR /src
- COPY ["CAUtilLib/CAUtilLib.csproj", "CAUtilLib/"]
- COPY ["CertificateAutorityServer/CertificateAutorityServer.csproj", "CertificateAutorityServer/"]
- RUN dotnet restore "CAUtilLib/CAUtilLib.csproj"
- RUN dotnet restore "CertificateAutorityServer/CertificateAutorityServer.csproj"
- COPY . .
- WORKDIR "/src/CertificateAutorityServer"
- RUN dotnet build "CertificateAutorityServer.csproj" -c Release -o /app/build
- FROM build AS publish
- RUN dotnet publish "CertificateAutorityServer.csproj" -c Release -o /app/publish /p:UseAppHost=false
- FROM base AS final
- WORKDIR /app
- COPY --from=publish /app/publish .
- COPY entrypoint.sh .
- RUN chmod +x /app/entrypoint.sh
- CMD ["/app/entrypoint.sh"]
|