diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3729ff0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/src/Dockerfile b/src/Dockerfile new file mode 100644 index 0000000..1728f7b --- /dev/null +++ b/src/Dockerfile @@ -0,0 +1,20 @@ +#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. + +FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["src/sodoffmmo.csproj", "src/"] +RUN dotnet restore "src/sodoffmmo.csproj" +COPY . . +WORKDIR "/src/src" +RUN dotnet build "sodoffmmo.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "sodoffmmo.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "sodoffmmo.dll"] \ No newline at end of file diff --git a/src/sodoffmmo.csproj b/src/sodoffmmo.csproj index 99a5f0a..11192e7 100644 --- a/src/sodoffmmo.csproj +++ b/src/sodoffmmo.csproj @@ -5,10 +5,13 @@ net6.0 enable enable + Linux + -p 9933:9933 +