-
-
Notifications
You must be signed in to change notification settings - Fork 602
/
start-server
executable file
·46 lines (39 loc) · 1.05 KB
/
start-server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
if [ -f ".env.default" ]
then
export $(cat .env.default | sed 's/#.*//g' | xargs)
fi
if [ -f ".env" ]
then
export $(cat .env | sed 's/#.*//g' | xargs)
fi
BINARY_PATH="${PWD}/../server/bin/neko"
# use -r to rebuild
if [ ! -f "${BINARY_PATH}" ] || [ "$1" == "-r" ]; then
./rebuild-server
fi
# if image starts with nvidia- add --gpus all
if [[ "${SERVER_TAG}" == "nvidia-"* ]]; then
GPU_FLAG="--gpus all"
echo "Nvidia GPU acceleration enabled"
fi
# if image starts with intel- add --device /dev/dri
if [[ "${SERVER_TAG}" == "intel-"* ]]; then
GPU_FLAG="--device /dev/dri"
echo "Intel GPU acceleration enabled"
fi
# use --gpus all to enable GPU acceleration
docker run --rm -it \
--name "neko_dev" \
$GPU_FLAG \
-p "${SERVER_PORT}:8080" \
-p "${SERVER_EPR}:${SERVER_EPR}/udp" \
-e "NEKO_SCREEN=1920x1080@60" \
-e "NEKO_EPR=${SERVER_EPR}" \
-e "NEKO_NAT1TO1=${SERVER_IP}" \
-e "NEKO_ICELITE=true" \
-e "NEKO_MAX_FPS=25" \
-v "${BINARY_PATH}:/usr/bin/neko" \
--shm-size=2G \
--cap-add SYS_ADMIN \
${BUILD_IMAGE}:${SERVER_TAG}