From eef5f45e8e09216942e00ab4c6560c837bf1000c Mon Sep 17 00:00:00 2001 From: SpringHgui <740360381@qq.com> Date: Wed, 30 Jun 2021 08:19:33 +0800 Subject: [PATCH] support vol in docker --- Dockerfile | 6 +++++- FastTunnel.Server/FastTunnel.Server.csproj | 2 ++ start.sh | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 start.sh diff --git a/Dockerfile b/Dockerfile index a665c75..405e8fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,10 @@ FROM build AS publish RUN dotnet publish "FastTunnel.Server.csproj" -c Release -o /app/publish FROM base AS final +#RUN mkdir -p /vols WORKDIR /app +COPY --from=publish /app/publish/config /vols/config COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "FastTunnel.Server.dll"] \ No newline at end of file +COPY ./start.sh . +ENTRYPOINT ["/bin/bash","start.sh"] +#ENTRYPOINT ["dotnet", "FastTunnel.Server.dll"] \ No newline at end of file diff --git a/FastTunnel.Server/FastTunnel.Server.csproj b/FastTunnel.Server/FastTunnel.Server.csproj index fc91777..eea9c5b 100644 --- a/FastTunnel.Server/FastTunnel.Server.csproj +++ b/FastTunnel.Server/FastTunnel.Server.csproj @@ -4,6 +4,7 @@ net5.0 c508b25f-0a51-4bab-b64c-8a7e993f24f6 true + Linux @@ -11,6 +12,7 @@ + diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..257a4cb --- /dev/null +++ b/start.sh @@ -0,0 +1,3 @@ +#!/bin/bash +mv -n /vols/config/* /app/config +dotnet FastTunnel.Server.dll \ No newline at end of file