Skip to content

Commit 3224995

Browse files
committed
fix #1
1 parent 901fdb7 commit 3224995

File tree

3 files changed

+69
-47
lines changed

3 files changed

+69
-47
lines changed

dockerfile.native

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM debian
22

3-
RUN apt-get update && apt-get install -y lib32gcc-s1 curl && rm -rf /var/lib/apt/lists/* && \
3+
RUN apt-get update && apt-get install -y lib32gcc-s1 curl && rm -rf /var/lib/apt/lists/* && apt-get clean && \
44
useradd -m -s /bin/bash 5k
55

66
ENV APPID=884110

dockerfile.wine

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
FROM debian
22

3-
RUN apt-get update && apt-get install -y lib32gcc-s1 curl wine && rm -rf /var/lib/apt/lists/* && \
3+
RUN apt-get update && apt-get install -y lib32gcc-s1 curl && rm -rf /var/lib/apt/lists/* && apt-get clean && \
44
useradd -m -s /bin/bash 5k
55

66
ENV APPID=884110
77
ENV STEAMPATH="/home/5k/Steam"
88
ENV SRVPATH="${STEAMPATH}/steamapps/common/SCP Pandemic Dedicated Server"
9-
ENV STARTCMD="wine ./WindowsServer/PandemicServer.exe"
109
ENV ARGS=""
1110

1211
USER 5k
1312
RUN mkdir -p "${STEAMPATH}" "${SRVPATH}" && cd "${STEAMPATH}" && \
1413
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
1514

15+
USER root
16+
RUN dpkg --add-architecture i386 && \
17+
mkdir -pm755 /etc/apt/keyrings && \
18+
curl -so /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key && \
19+
curl -so /etc/apt/sources.list.d/winehq-bookworm.sources https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources && \
20+
apt-get update && apt-get install -y --install-recommends winehq-staging && \
21+
rm -rf /var/lib/apt/lists/* && apt-get clean
22+
23+
ENV STARTENV="WINEDLLOVERRIDES=dwmapi=native,builtin"
24+
ENV STARTCMD="wine ./WindowsServer/PandemicServer.exe"
25+
26+
USER 5k
1627
CMD "${STEAMPATH}/steamcmd.sh" @ShutdownOnFailedCommand @NoPromptForPassword +@sSteamCmdForcePlatformType windows +login anonymous +app_update ${APPID} +'quit' && \
17-
cd "${SRVPATH}" && ${STARTCMD} ${ARGS}
28+
cd "${SRVPATH}" && if [ -n "${STARTENV}" ]; then export ${STARTENV} && ${STARTCMD} ${ARGS}; else ${STARTCMD} ${ARGS}; fi

readme.md

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ We currently have two different implementations, you need to choose one accordin
1010

1111
**Wine**: Runs windows version of server by using wine, made for people who want use `UE4SS`
1212

13+
[For people who just want quickly host a server](#quick-start)
14+
15+
[For people who want know more about this](#advanced)
16+
17+
[让我们说中文 | For people who not a english speaker](#使用方法)
18+
19+
## Quick Start
20+
1321
### Step 1
1422

1523
Pull docker image
@@ -42,7 +50,7 @@ You can access your server files later at `/var/lib/docker/volumes/<volume_name>
4250
Enter command to start your server
4351

4452
```bash
45-
docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" <6> -v <7>:"/home/5k/Steam/steamapps/common/SCP Pandemic Dedicated Server" <8>
53+
docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" -v <6>:"/home/5k/Steam/steamapps/common/SCP Pandemic Dedicated Server" <7>
4654
```
4755

4856
**1**: Any name for container
@@ -53,29 +61,11 @@ docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" <6> -v <7>:"/home/5k/Stea
5361

5462
**4**: Add muiltple `-p <2>:<2>/<3>` for forwarding muiltple ports
5563

56-
**5**: Params you want send to server, leave empty if you dont wanna send any params
57-
58-
**6**: **Wine ONLY**: Leave empty if you are using **Native** version
59-
60-
If you want to edit the game server's startup command, replace '<6>' with this
64+
**5**: Params you want send to the server, leave empty if you dont wanna send any params
6165

62-
If you dont want edit it, leave empty
66+
**6**: The volume name you just created
6367

64-
```bash
65-
-e STARTCMD="wine ./WindowsServer/PandemicServer.exe"
66-
```
67-
68-
Now you can change the startup command by edit the content inside the `""`
69-
70-
Example:
71-
72-
```bash
73-
-e STARTCMD="wine ./StartServer.bat"
74-
```
75-
76-
**7**: The volume name you just created
77-
78-
**8**: Image name
68+
**7**: Image name
7969

8070
Image name of **Native**: `ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi`
8171

@@ -91,6 +81,23 @@ docker run --name scp5kserver -p 7777:7777/tcp -p 7777:7777/udp -p 27015:27015/t
9181

9282
Add `-d` if you want it running on background
9383

84+
<br/>
85+
86+
## Advanced
87+
88+
You have to create a volume for stoagre your server files, mount it on `/home/5k/Steam/steamapps/common/SCP Pandemic Dedicated Server`
89+
90+
| ENVs | Native | Wine | Default Value | Description |
91+
|----------- |-------- |------ |--------------------------------------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
92+
| APPID | YES | YES | 884110 | Game server's steam appid |
93+
| STEAMPATH | YES | YES | "/home/5k/Steam" | Steamcmd path |
94+
| SRVPATH | YES | YES | "${STEAMPATH}/steamapps/common/SCP Pandemic Dedicated Server" | Game server path |
95+
| ARGS | YES | YES | "" | The params you want sent to the server |
96+
| STARTENV | NO | YES | "WINEDLLOVERRIDES=dwmapi=native,builtin" | Start envs, **DONT MODIFY** unless you sure what are you doing.<br/>if you want running vanilla server but failed to starting, try clean it (**may cause `UE4SS` not loading**) |
97+
| STARTCMD | NO | YES | "wine ./WindowsServer/PandemicServer.exe" | Start command, used for start server, you can change it according you needs.<br/>For example: `"wine ./StartServer.bat"` |
98+
99+
----
100+
94101
### 使用方法
95102

96103
> "<>"内的文字需要你根据你的需求自行替换,并删掉"<>"
@@ -101,6 +108,13 @@ Add `-d` if you want it running on background
101108

102109
**Wine**: 使用wine来跑windows的服务器,为那些想要使用`UE4SS`的人制作
103110

111+
[对于那些只是想快速搭建一个服务器的人](#快速开始)
112+
113+
[对于那些想要了解更多的人](#高级)
114+
115+
116+
## 快速开始
117+
104118
### Step 1
105119

106120
拉取镜像
@@ -133,7 +147,7 @@ docker volume create <1>
133147
使用这个指令启动你的服务器
134148

135149
```bash
136-
docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" <6> -v <7>:"/home/5k/Steam/steamapps/common/SCP Pandemic Dedicated Server" <8>
150+
docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" -v <6>:"/home/5k/Steam/steamapps/common/SCP Pandemic Dedicated Server" <7>
137151
```
138152

139153
**1**: 为你的container取一个名字
@@ -146,27 +160,9 @@ docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" <6> -v <7>:"/home/5k/Stea
146160

147161
**5**: 传递给服务器的参数,如果你不想传递任何参数,留空
148162

149-
**6**: **仅限Wine**: 如果你使用的是**Native**版本,留空
150-
151-
如果你想编辑游戏服务器的启动指令,将`<6>`替换为下方内容
152-
153-
如果你不想改,留空
154-
155-
```bash
156-
-e STARTCMD="wine ./WindowsServer/PandemicServer.exe"
157-
```
158-
159-
你现在可以通过编辑`""`内的指令来更改游戏服务器的启动指令
160-
161-
举例:
162-
163-
```bash
164-
-e STARTCMD="wine ./StartServer.bat"
165-
```
166-
167-
**7**: 你刚刚创建的volume名
163+
**6**: 你刚刚创建的volume名
168164

169-
**8**: 镜像名
165+
**7**: 镜像名
170166

171167
**Native**的镜像名: `ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi`
172168

@@ -181,3 +177,18 @@ docker run --name scp5kserver -p 7777:7777/tcp -p 7777:7777/udp -p 27015:27015/t
181177
```
182178

183179
如果你希望运行在后台,加 `-d`
180+
181+
<br/>
182+
183+
## 高级
184+
185+
你需要创建一个volume存储你的服务器文件,并挂载在`/home/5k/Steam/steamapps/common/SCP Pandemic Dedicated Server`
186+
187+
| ENVs | Native | Wine | 默认值 | 描述 |
188+
|----------- |-------- |------ |--------------------------------------------------------------- |----------------------------------------------------------------------------------------------------------------------------------- |
189+
| APPID | YES | YES | 884110 | 游戏服务器的steam appid |
190+
| STEAMPATH | YES | YES | "/home/5k/Steam" | steamcmd的路径 |
191+
| SRVPATH | YES | YES | "${STEAMPATH}/steamapps/common/SCP Pandemic Dedicated Server" | 游戏服务器的路径 |
192+
| ARGS | YES | YES | "" | 你想发给服务器的参数 |
193+
| STARTENV | NO | YES | "WINEDLLOVERRIDES=dwmapi=native,builtin" | 环境变量,如果你不知道你在做什么,**不要更改**<br/>如果你想开原版服务器并在启动时遇到问题,尝试重写为空(**可能会导致`UE4SS`不工作**|
194+
| STARTCMD | NO | YES | "wine ./WindowsServer/PandemicServer.exe" | 用于开启服务器的指令,你可以根据你的需要更改<br/>举例: `"wine ./StartServer.bat"` |

0 commit comments

Comments
 (0)