mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-22 03:05:16 +00:00
46 lines
1.3 KiB
Text
46 lines
1.3 KiB
Text
|
################################################################################
|
||
|
################################################################## build ###
|
||
|
|
||
|
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/sdk:6.0 as build
|
||
|
|
||
|
WORKDIR /app/
|
||
|
|
||
|
COPY ./Server/ ./Server/
|
||
|
COPY ./Shared/ ./Shared/
|
||
|
|
||
|
ARG TARGETARCH
|
||
|
|
||
|
# Download NuGet dependencies
|
||
|
RUN dotnet restore \
|
||
|
./Server/Server.csproj \
|
||
|
-r debian.11-`echo $TARGETARCH | sed 's@^amd@x@'` \
|
||
|
;
|
||
|
|
||
|
# Build application binary
|
||
|
RUN dotnet publish \
|
||
|
./Server/Server.csproj \
|
||
|
-r debian.11-`echo $TARGETARCH | sed 's@^amd@x@'` \
|
||
|
-c Release \
|
||
|
-o ./out/ \
|
||
|
--no-restore \
|
||
|
--self-contained \
|
||
|
-p:publishSingleFile=true \
|
||
|
;
|
||
|
|
||
|
################################################################## build ###
|
||
|
################################################################################
|
||
|
################################################################ runtime ###
|
||
|
|
||
|
FROM mcr.microsoft.com/dotnet/runtime:6.0 as runtime
|
||
|
|
||
|
# Copy application binary from build stage
|
||
|
COPY --from=build /app/out/ /app/
|
||
|
|
||
|
ENTRYPOINT [ "/app/Server" ]
|
||
|
EXPOSE 1027/tcp
|
||
|
WORKDIR /data/
|
||
|
VOLUME /data/
|
||
|
|
||
|
################################################################ runtime ###
|
||
|
################################################################################
|