Dockerfile 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #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.
  2. FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
  3. WORKDIR /app
  4. EXPOSE 80
  5. EXPOSE 443
  6. RUN apt-get update \
  7. && apt-get install -y --no-install-recommends dialog \
  8. && apt-get install -y --no-install-recommends openssh-server \
  9. && apt-get install -y tcpdump\
  10. && mkdir -p /run/sshd \
  11. && echo "root:Docker!" | chpasswd
  12. COPY sshd_config /etc/ssh/sshd_config
  13. FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
  14. WORKDIR /src
  15. COPY ["EVCB_OCPP.DBAPI/EVCB_OCPP.DBAPI.csproj", "EVCB_OCPP.DBAPI/"]
  16. RUN dotnet restore "EVCB_OCPP.DBAPI/EVCB_OCPP.DBAPI.csproj"
  17. COPY . .
  18. WORKDIR "/src/EVCB_OCPP.DBAPI"
  19. RUN dotnet build "EVCB_OCPP.DBAPI.csproj" -c Release -o /app/build
  20. FROM build AS publish
  21. RUN dotnet publish "EVCB_OCPP.DBAPI.csproj" -c Release -o /app/publish /p:UseAppHost=false
  22. FROM base AS final
  23. WORKDIR /app
  24. COPY --from=publish /app/publish .
  25. COPY entrypoint.sh .
  26. RUN chmod +x /app/entrypoint.sh
  27. CMD ["/app/entrypoint.sh"]