]> git.deb.at Git - rhonda/impostor.git/commitdiff
Reduce docker image by half
authorAeonLucid <aeonlucid@gmail.com>
Sun, 20 Sep 2020 23:52:29 +0000 (01:52 +0200)
committerAeonLucid <aeonlucid@gmail.com>
Sun, 20 Sep 2020 23:52:29 +0000 (01:52 +0200)
.dockerignore [new file with mode: 0644]
Dockerfile

diff --git a/.dockerignore b/.dockerignore
new file mode 100644 (file)
index 0000000..9163c62
--- /dev/null
@@ -0,0 +1,9 @@
+.dockerignore
+.env
+.gitignore
+.vs
+.vscode
+**/.git
+**/.idea
+**/bin
+**/obj
\ No newline at end of file
index c0cd7f26f14c065db74ee9f850fc07d9dc65f95c..bca3c3e5b1397841ac25fd7d04ee2df19ef0ecc9 100644 (file)
@@ -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