mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-19 15:51:42 +00:00
Reduce docker image by half
This commit is contained in:
1 parent
4a5af45dba
commit
8392381306
2 files changed
+15
-5
No files matched your search
@@ -0,0 +1,9 @@
|
||||
.dockerignore
|
||||
.env
|
||||
.gitignore
|
||||
.vs
|
||||
.vscode
|
||||
**/.git
|
||||
**/.idea
|
||||
**/bin
|
||||
**/obj
|
||||
+6
-5
@@ -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"]
|
||||
Reference in new issue
Block a user