33 lines
1.1 KiB
Docker
33 lines
1.1 KiB
Docker
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
|
WORKDIR /app
|
|
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|
ARG BUILD_CONFIGURATION=Release
|
|
WORKDIR /src
|
|
COPY NuGet.Config ./
|
|
COPY ["*.sln", "."]
|
|
COPY ["Alchegos.MCP.csproj", "./"]
|
|
RUN dotnet restore "Alchegos.MCP.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/"
|
|
RUN dotnet build "./Alchegos.MCP.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
|
|
|
FROM build AS publish
|
|
ARG BUILD_CONFIGURATION=Release
|
|
RUN dotnet publish "./Alchegos.MCP.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
USER root
|
|
RUN apt-get update
|
|
RUN apt-get install -y --no-install-recommends openssh-client openssh-server
|
|
RUN rm -rf /var/lib/apt/lists/*
|
|
RUN mkdir -p /var/run/sshd
|
|
RUN sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
RUN sed -i 's/#PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
|
RUN ssh-keygen -t rsa -b 4096 -N "" -q -f /root/.ssh/id_rsa
|
|
COPY ./jetbrains_debugger_agent_20240726.40.0 /app/rdb
|
|
ENTRYPOINT ["dotnet", "Alchegos.MCP.dll"]
|