File tree Expand file tree Collapse file tree 7 files changed +413
-2122
lines changed Expand file tree Collapse file tree 7 files changed +413
-2122
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ name: Docker
7
7
8
8
on :
9
9
push :
10
- branches : ["main", " dev"]
10
+ branches : ["dev-bun "]
11
11
tags : [ 'v*.*.*' ]
12
12
13
13
env :
Original file line number Diff line number Diff line change 1
1
# Creates a runnable environment with a dedicated server and trakman
2
- FROM node:lts- alpine
2
+ FROM oven/bun: alpine
3
3
# create directory, install xml editing tool and setup non-root user
4
4
RUN adduser -h /app/server -s /bin/sh -D -u 1001 server && \
5
- apk add xmlstarlet su-exec && \
6
-
5
+ apk add xmlstarlet su-exec
7
6
USER server
8
7
WORKDIR /app/server
9
8
# copy useful trakman files and entrypoint command
@@ -20,9 +19,8 @@ RUN wget -O serv.zip http://files2.trackmaniaforever.com/TrackmaniaServer_2011-0
20
19
Readme_Dedicated.html RemoteControlExamples TrackmaniaServer.exe manialink_dedicatedserver.txt
21
20
# generate file hashes, get trakman dependencies and build
22
21
WORKDIR /app/server/trakmanbk
23
- RUN node Update.js && \
24
- npm i && \
25
- npm run build
22
+ RUN bun Update.js && \
23
+ bun i
26
24
WORKDIR /app/server
27
25
# backup important files to prevent them being deleted by mounting the volume
28
26
RUN mv GameData/Config/dedicated_cfg.txt dedicated_cfg.txt.bk && \
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
1
services :
2
2
trakman :
3
- image : borecek/trakman:main
3
+ image : borecek/trakman:dev-bun
4
4
container_name : trakman-server
5
5
restart : unless-stopped
6
6
volumes :
Original file line number Diff line number Diff line change 36
36
if find /app/server/trakman -mindepth 1 -maxdepth 1 | read ; then
37
37
echo ' Trakman exists. Attempting update...'
38
38
cd trakman || exit
39
- node Update.js /app/server/trakmanbk/.hashes.json
39
+ bun Update.js /app/server/trakmanbk/.hashes.json
40
40
if [ $? -gt 0 ]; then
41
41
chown server:server update.log
42
42
echo ' Update not fully successful, please stop the container.'
@@ -74,12 +74,13 @@ echo "#!/bin/sh
74
74
echo 'Server exited with code ' $?
75
75
echo 'Restarting...'
76
76
done) &
77
- npm i --prefix /app/server/trakman
78
- npm run build --prefix /app/server/trakman
79
- chmod -R a+w /app/server
80
77
cd trakman
81
- trap 'echo Terminating; npx pm2 stop 0; npx pm2 kill; exit' SIGTERM SIGINT
82
- npx pm2 start ./built/src/Main.js --name Trakman
78
+ bun i
79
+ chmod -R a+w /app/server
80
+ sleep 1 # wait for dedicated server to finish loading
81
+ trap 'echo Terminating; bun pm2 stop 0; bun pm2 kill; exit' SIGTERM SIGINT
82
+ bun pm2 ls # idk why but the controller starts not without this
83
+ bun pm2 start --interpreter bun src/Main.ts --name Trakman
83
84
wait $! " > run.sh
84
85
chown server:server run.sh
85
86
chmod 766 run.sh
You can’t perform that action at this time.
0 commit comments