Skip to content

Commit 901fdb7

Browse files
committed
add wine based implementations
1 parent 7c07734 commit 901fdb7

File tree

4 files changed

+129
-21
lines changed

4 files changed

+129
-21
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,42 @@ jobs:
1717

1818
steps:
1919
- name: Checkout repository
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121

2222
- name: Generate tags
2323
run: |
2424
repo=${{ github.repository }};
25-
echo "CURR_TAG=ghcr.io/${repo,,}/5k-dedi:${GITHUB_SHA::7}" >> $GITHUB_ENV
26-
echo "LATEST_TAG=ghcr.io/${repo,,}/5k-dedi:latest" >> $GITHUB_ENV
25+
echo "NATIVE_CURR_TAG=ghcr.io/${repo,,}/5k-dedi:${GITHUB_SHA::7}" >> $GITHUB_ENV
26+
echo "NATIVE_LATEST_TAG=ghcr.io/${repo,,}/5k-dedi:latest" >> $GITHUB_ENV
27+
echo "WINE_CURR_TAG=ghcr.io/${repo,,}/5k-dedi-wine:${GITHUB_SHA::7}" >> $GITHUB_ENV
28+
echo "WINE_LATEST_TAG=ghcr.io/${repo,,}/5k-dedi-wine:latest" >> $GITHUB_ENV
2729
2830
- name: Set up Docker Buildx
29-
uses: docker/setup-buildx-action@v2
31+
uses: docker/setup-buildx-action@v3
3032

3133
- name: Login to GitHub Container Registry
32-
uses: docker/login-action@v2
34+
uses: docker/login-action@v3
3335
with:
3436
registry: ghcr.io
3537
username: ${{github.actor}}
3638
password: ${{secrets.GITHUB_TOKEN}}
3739

38-
- name: Build Docker image
39-
uses: docker/build-push-action@v2
40+
- name: "Build Docker image: Native"
41+
uses: docker/build-push-action@v6
4042
with:
4143
context: .
44+
file: dockerfile.native
4245
push: true
4346
tags: |
44-
${{ env.CURR_TAG }}
45-
${{ env.LATEST_TAG }}
47+
${{ env.NATIVE_CURR_TAG }}
48+
${{ env.NATIVE_LATEST_TAG }}
49+
50+
- name: "Build Docker image: Wine"
51+
uses: docker/build-push-action@v6
52+
with:
53+
context: .
54+
file: dockerfile.wine
55+
push: true
56+
tags: |
57+
${{ env.WINE_CURR_TAG }}
58+
${{ env.WINE_LATEST_TAG }}

dockerfile renamed to 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 update && apt 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/* && \
44
useradd -m -s /bin/bash 5k
55

66
ENV APPID=884110

dockerfile.wine

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM debian
2+
3+
RUN apt-get update && apt-get install -y lib32gcc-s1 curl wine && rm -rf /var/lib/apt/lists/* && \
4+
useradd -m -s /bin/bash 5k
5+
6+
ENV APPID=884110
7+
ENV STEAMPATH="/home/5k/Steam"
8+
ENV SRVPATH="${STEAMPATH}/steamapps/common/SCP Pandemic Dedicated Server"
9+
ENV STARTCMD="wine ./WindowsServer/PandemicServer.exe"
10+
ENV ARGS=""
11+
12+
USER 5k
13+
RUN mkdir -p "${STEAMPATH}" "${SRVPATH}" && cd "${STEAMPATH}" && \
14+
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
15+
16+
CMD "${STEAMPATH}/steamcmd.sh" @ShutdownOnFailedCommand @NoPromptForPassword +@sSteamCmdForcePlatformType windows +login anonymous +app_update ${APPID} +'quit' && \
17+
cd "${SRVPATH}" && ${STARTCMD} ${ARGS}

readme.md

Lines changed: 89 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
# SCP-5K Dedicated Server For Docker
22

3-
### Usage
3+
## Usage
44

55
> The text under "<>" meanning you have to replace it by youself according to your needs, and delete "<>"
66
7-
#### Step 1
7+
We currently have two different implementations, you need to choose one according you needs
8+
9+
**Native**: A simple setup by using native linux server, choose this if you have no idea about which option to pick
10+
11+
**Wine**: Runs windows version of server by using wine, made for people who want use `UE4SS`
12+
13+
### Step 1
814

915
Pull docker image
1016

17+
#### Native
18+
1119
```bash
1220
docker pull ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi:latest
1321
```
22+
#### Wine
23+
24+
```bash
25+
docker pull ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi-wine:latest
26+
```
1427

15-
#### Step 2
28+
### Step 2
1629

1730
Create a volume for storage your server files
1831

@@ -24,12 +37,12 @@ docker volume create <1>
2437

2538
You can access your server files later at `/var/lib/docker/volumes/<volume_name>/_data/`
2639

27-
#### Step 3
40+
### Step 3
2841

2942
Enter command to start your server
3043

3144
```bash
32-
docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" -v <6>:"/home/5k/Steam/steamapps/common/SCP Pandemic Dedicated Server" ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi
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>
3346
```
3447

3548
**1**: Any name for container
@@ -42,7 +55,33 @@ docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" -v <6>:"/home/5k/Steam/st
4255

4356
**5**: Params you want send to server, leave empty if you dont wanna send any params
4457

45-
**6**: The volume name you just created
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
61+
62+
If you dont want edit it, leave empty
63+
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
79+
80+
Image name of **Native**: `ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi`
81+
82+
Image name of **Wine**: `ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi-wine`
83+
84+
----
4685

4786
Example:
4887

@@ -56,15 +95,28 @@ Add `-d` if you want it running on background
5695

5796
> "<>"内的文字需要你根据你的需求自行替换,并删掉"<>"
5897
59-
#### Step 1
98+
我们目前有两种不同的实现,根据你的需求选择一个
99+
100+
**Native**: 一个跑原生linux服务器的简单实现,如果你不知道选哪个,选这个
101+
102+
**Wine**: 使用wine来跑windows的服务器,为那些想要使用`UE4SS`的人制作
103+
104+
### Step 1
60105

61106
拉取镜像
62107

108+
#### Native
109+
63110
```bash
64111
docker pull ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi:latest
65112
```
113+
#### Wine
66114

67-
#### Step 2
115+
```bash
116+
docker pull ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi-wine:latest
117+
```
118+
119+
### Step 2
68120

69121
创建一个volume用于存储你的服务器文件
70122

@@ -76,12 +128,12 @@ docker volume create <1>
76128

77129
你可以稍后在 `/var/lib/docker/volumes/<volume_name>/_data/` 访问你的服务器文件
78130

79-
#### Step 3
131+
### Step 3
80132

81133
使用这个指令启动你的服务器
82134

83135
```bash
84-
docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" -v <6>:"/home/5k/Steam/steamapps/common/SCP Pandemic Dedicated Server" ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi
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>
85137
```
86138

87139
**1**: 为你的container取一个名字
@@ -94,7 +146,33 @@ docker run --name <1> -p <2>:<2>/<3> <4> -e ARGS="<5>" -v <6>:"/home/5k/Steam/st
94146

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

97-
**6**: 你刚刚创建的volume名
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名
168+
169+
**8**: 镜像名
170+
171+
**Native**的镜像名: `ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi`
172+
173+
**Wine**的镜像名: `ghcr.io/lightbluecube/5k-dedi-docker/5k-dedi-wine`
174+
175+
----
98176

99177
示例:
100178

0 commit comments

Comments
 (0)