diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..210bed5 --- /dev/null +++ b/dockerfile @@ -0,0 +1,7 @@ +FROM mcr.microsoft.com/dotnet/aspnet:10.0 +WORKDIR /app + +COPY bin/Release/net10.0/linux-x64/publish/ . +EXPOSE 5116 + +ENTRYPOINT ["dotnet", "NoteApi.dll"] \ No newline at end of file diff --git a/publish.md b/publish.md new file mode 100644 index 0000000..7693385 --- /dev/null +++ b/publish.md @@ -0,0 +1,12 @@ +# 编译/发布 +```powershell +dotnet publish -c Release -r linux-x64 --no-self-contained +docker build -t noteapi:latest . +docker save noteapi:latest | gzip > noteapi.tar.gz +``` +# 复原 +```powershell +dotnet publish -c Release -r linux-x64 --no-self-contained +docker build -t noteapi:latest . +docker save noteapi:latest | gzip > noteapi.tar.gz +``` \ No newline at end of file