spt4.0.0(eft0.16.6.0.36679)
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
FROM node:22.12.0-bullseye AS server-builder
|
||||
RUN apt update && apt install -y git git-lfs p7zip-full && \
|
||||
git clone -b 3.11.x-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS server-builder
|
||||
ARG SPT_VERSION
|
||||
ARG SPT_BUILD_TYPE
|
||||
RUN apt update && apt install -y git git-lfs wget && \
|
||||
git clone -b develop --depth=1 https://git.rui.he.cn:3000/SP-Tarkov/server-csharp.git /snapshot && \
|
||||
cd /snapshot && git lfs pull && \
|
||||
cd project && \
|
||||
npm install && npm run build:release && \
|
||||
cd Libraries/SPTarkov.Server.Assets/Assets/configs && sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Linux\",/g" core.json && \
|
||||
cd /snapshot/Libraries/SPTarkov.Server.Assets/Assets/images/launcher && rm bg.png && wget https://raw.githubusercontent.com/AirryCo/spt-server-ci/refs/heads/main/custom/bg.png && \
|
||||
cd /snapshot && \
|
||||
dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj -c Release -f net9.0 -r linux-x64 -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true --self-contained false -p:SptBuildType=$SPT_BUILD_TYPE -p:SptVersion=$SPT_VERSION -p:SptBuildTime=$( date +%Y%m%d ) -p:SptCommit=$(git rev-parse --short HEAD) && \
|
||||
rm SPTarkov.Server/bin/Release/net9.0/linux-x64/publish/*.pdb && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim
|
||||
LABEL author="AirryCo <henry@stblog.com.cn>"
|
||||
ENV TZ=Asia/Shanghai
|
||||
COPY --from=server-builder /snapshot/project/build/ /app/spt-server/
|
||||
COPY --from=server-builder /snapshot/SPTarkov.Server/bin/Release/net9.0/linux-x64/publish/ /app/spt-server/
|
||||
VOLUME /opt/spt-server
|
||||
WORKDIR /opt/spt-server
|
||||
EXPOSE 6969
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
|
||||
23
docker/Dockerfile-nightly-arm64
Normal file
23
docker/Dockerfile-nightly-arm64
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim-arm64v8 AS server-builder
|
||||
ARG SPT_VERSION
|
||||
ARG SPT_BUILD_TYPE
|
||||
RUN apt update && apt install -y git git-lfs wget && \
|
||||
git clone -b develop --depth=1 https://git.rui.he.cn:3000/SP-Tarkov/server-csharp.git /snapshot && \
|
||||
cd /snapshot && git lfs pull && \
|
||||
cd Libraries/SPTarkov.Server.Assets/Assets/configs && sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Linux\",/g" core.json && \
|
||||
cd /snapshot/Libraries/SPTarkov.Server.Assets/Assets/images/launcher && rm bg.png && wget https://raw.githubusercontent.com/AirryCo/spt-server-ci/refs/heads/main/custom/bg.png && \
|
||||
cd /snapshot && \
|
||||
dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj -c Release -f net9.0 -r linux-arm64 -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true --self-contained false -p:SptBuildType=$SPT_BUILD_TYPE -p:SptVersion=$SPT_VERSION -p:SptBuildTime=$( date +%Y%m%d ) -p:SptCommit=$(git rev-parse --short HEAD) && \
|
||||
rm SPTarkov.Server/bin/Release/net9.0/linux-arm64/publish/*.pdb && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim-arm64v8
|
||||
LABEL author="AirryCo <henry@stblog.com.cn>"
|
||||
ENV TZ=Asia/Shanghai
|
||||
COPY --from=server-builder /snapshot/SPTarkov.Server/bin/Release/net9.0/linux-arm64/publish/ /app/spt-server/
|
||||
VOLUME /opt/spt-server
|
||||
WORKDIR /opt/spt-server
|
||||
EXPOSE 6969
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f /opt/spt-server/SPT.Server ]; then
|
||||
appHash=$(md5sum /app/spt-server/SPT.Server | awk '{ print $1 }')
|
||||
exeHash=$(md5sum /opt/spt-server/SPT.Server | awk '{ print $1 }')
|
||||
if [ -f /opt/spt-server/SPTarkov.Server ]; then
|
||||
appHash=$(md5sum /app/spt-server/SPTarkov.Server | awk '{ print $1 }')
|
||||
exeHash=$(md5sum /opt/spt-server/SPTarkov.Server | awk '{ print $1 }')
|
||||
if [ "$appHash" = "$exeHash" ]; then
|
||||
echo "MD5 verification successful!"
|
||||
else
|
||||
@@ -18,10 +18,16 @@ fi
|
||||
|
||||
cd /opt/spt-server
|
||||
|
||||
if [ -z "$backendIp" ]; then
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
if [ -z "$ip" ]; then
|
||||
IP="0.0.0.0"
|
||||
else
|
||||
IP=$backendIp
|
||||
IP=$ip
|
||||
fi
|
||||
|
||||
if [ -z "$backendIp" ]; then
|
||||
BACKEND_IP=$(hostname -I | awk '{print $1}')
|
||||
else
|
||||
BACKEND_IP=$backendIp
|
||||
fi
|
||||
|
||||
if [ -z "$backendPort" ]; then
|
||||
@@ -36,11 +42,10 @@ else
|
||||
PINGDELAYMS=$webSocketPingDelayMs
|
||||
fi
|
||||
|
||||
sed -Ei "s/\"ip\": \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",/\"ip\": \"0.0.0.0\",/g" SPT_Data/Server/configs/http.json
|
||||
sed -Ei "s/\"port\": ([0-9]|[1-9][1-9]{1,3}|[1-5][0-9]{4}|6[1-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]),/\"port\": ${PORT},/g" SPT_Data/Server/configs/http.json
|
||||
sed -Ei "s/\"backendIp\": \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",/\"backendIp\": \"${IP}\",/g" SPT_Data/Server/configs/http.json
|
||||
sed -Ei "s/\"backendPort\": ([0-9]|[1-9][1-9]{1,3}|[1-5][0-9]{4}|6[1-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]),/\"backendPort\": ${PORT},/g" SPT_Data/Server/configs/http.json
|
||||
sed -Ei "s/\"webSocketPingDelayMs\": ([0-9]{1,}),/\"webSocketPingDelayMs\": ${PINGDELAYMS},/g" SPT_Data/Server/configs/http.json
|
||||
|
||||
chmod +x SPT.Server && ./SPT.Server
|
||||
sed -Ei "s/\"ip\": \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",/\"ip\": \"${IP}\",/g" Assets/configs/http.json
|
||||
sed -Ei "s/\"port\": ([0-9]|[1-9][1-9]{1,3}|[1-5][0-9]{4}|6[1-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]),/\"port\": ${PORT},/g" Assets/configs/http.json
|
||||
sed -Ei "s/\"backendIp\": \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",/\"backendIp\": \"${BACKEND_IP}\",/g" Assets/configs/http.json
|
||||
sed -Ei "s/\"backendPort\": ([0-9]|[1-9][1-9]{1,3}|[1-5][0-9]{4}|6[1-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]),/\"backendPort\": ${PORT},/g" Assets/configs/http.json
|
||||
sed -Ei "s/\"webSocketPingDelayMs\": ([0-9]{1,}),/\"webSocketPingDelayMs\": ${PINGDELAYMS},/g" Assets/configs/http.json
|
||||
|
||||
chmod +x SPTarkov.Server && ./SPTarkov.Server
|
||||
|
||||
Reference in New Issue
Block a user