Dockerfile 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #See https://aka.ms/containerfastmode to understand 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. RUN sed -i 's/TLSv1.2/TLSv1/g' /etc/ssl/openssl.cnf
  4. RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf
  5. EXPOSE 80
  6. EXPOSE 443
  7. EXPOSE 54088
  8. WORKDIR /app
  9. FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
  10. WORKDIR /src
  11. COPY ["EVCB_OCPP.WSServer/EVCB_OCPP.WSServer.csproj", "EVCB_OCPP.WSServer/"]
  12. COPY ["SuperWebSocket/SuperWebSocket.csproj", "SuperWebSocket/"]
  13. COPY ["SocketBase/SuperSocket.SocketBase.csproj", "SocketBase/"]
  14. COPY ["SocketCommon/SuperSocket.Common.csproj", "SocketCommon/"]
  15. COPY ["SocketEngine/SuperSocket.SocketEngine.csproj", "SocketEngine/"]
  16. RUN dotnet restore "EVCB_OCPP.WSServer/EVCB_OCPP.WSServer.csproj"
  17. COPY . .
  18. WORKDIR "/src/EVCB_OCPP.WSServer"
  19. RUN dotnet build "EVCB_OCPP.WSServer.csproj" -c Release -o /app/build
  20. FROM build AS publish
  21. RUN dotnet publish "EVCB_OCPP.WSServer.csproj" -c Release -o /app/publish /p:UseAppHost=false
  22. FROM base AS final
  23. WORKDIR /app
  24. COPY --from=publish /app/publish .
  25. ENTRYPOINT ["dotnet", "EVCB_OCPP.WSServer.dll"]