diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..9163c629e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.gitignore +.vs +.vscode +**/.git +**/.idea +**/bin +**/obj \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c0cd7f26f..bca3c3e5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,17 +6,18 @@ COPY src/Impostor.Server/Impostor.Server.csproj ./src/Impostor.Server/Impostor.S COPY src/Impostor.Shared/Impostor.Shared.csproj ./src/Impostor.Shared/Impostor.Shared.csproj COPY submodules/Hazel-Networking/Hazel/Hazel.csproj ./submodules/Hazel-Networking/Hazel/Hazel.csproj -RUN dotnet restore -r linux-x64 ./src/Impostor.Server/Impostor.Server.csproj && \ - dotnet restore -r linux-x64 ./src/Impostor.Shared/Impostor.Shared.csproj && \ - dotnet restore -r linux-x64 ./submodules/Hazel-Networking/Hazel/Hazel.csproj +RUN dotnet restore -r linux-musl-x64 ./src/Impostor.Server/Impostor.Server.csproj && \ + dotnet restore -r linux-musl-x64 ./src/Impostor.Shared/Impostor.Shared.csproj && \ + dotnet restore -r linux-musl-x64 ./submodules/Hazel-Networking/Hazel/Hazel.csproj # Copy everything else. COPY submodules/. ./submodules/ COPY src/. ./src/ -RUN dotnet publish -c release -o /app -f netcoreapp3.1 -r linux-x64 --self-contained false --no-restore ./src/Impostor.Server/Impostor.Server.csproj +RUN dotnet publish -c release -o /app -f netcoreapp3.1 -r linux-musl-x64 --self-contained false --no-restore ./src/Impostor.Server/Impostor.Server.csproj # Final image. -FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim +FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine WORKDIR /app COPY --from=build /app ./ +EXPOSE 22023/udp ENTRYPOINT ["./Impostor.Server"] \ No newline at end of file