mirror of
https://ceregatti.org/git/daniel/dayzdockerserver.git
synced 2025-05-06 22:31:18 +00:00
Update docs. Add TL;DR.
This commit is contained in:
parent
52850e6551
commit
a142b9101f
2 changed files with 48 additions and 10 deletions
48
README.md
48
README.md
|
@ -8,10 +8,30 @@ The goal is to provide a vanilla DayZ server that can be spun up with as little
|
||||||
|
|
||||||
This branch is called `simple`, because that's the intent: To keep things simple:
|
This branch is called `simple`, because that's the intent: To keep things simple:
|
||||||
|
|
||||||
* One container. The server runs in the same container used to manage it.
|
* A Debian slim image with `steamcmd` and enough utilities installed to run a DayZ server.
|
||||||
* One local bind mount. All files are stored in a directory on the host machine.
|
* All server and steamcmd files are persisted in the host user's home directory using a bind mount.
|
||||||
* No root requirement. The container and its files are owned by the host user and kept entirely in that user's home directory.
|
* Everything else is left to the user to run by hand using commands similar to the official documentation.
|
||||||
* Everything is left to the user to run by hand using commands similar to the official documentation.
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone https://ceregatti.org/git/daniel/dayzdockerserver.git
|
||||||
|
cd dayzdockerserver
|
||||||
|
git checkout simple
|
||||||
|
echo "export USER_ID=$(id -u)" | tee .env
|
||||||
|
mkdir dayz
|
||||||
|
docker compose up -d --build
|
||||||
|
docker compose exec dayz bash
|
||||||
|
```
|
||||||
|
|
||||||
|
```docker
|
||||||
|
export STEAM_USERNAME='MySteamUserName'
|
||||||
|
steamcmd +login "${STEAM_USERNAME}" +quit
|
||||||
|
steamcmd +login "${STEAM_USERNAME}" +force_install_dir /home/user/dayz/serverfiles +app_update 223350 validate +quit
|
||||||
|
nano /home/user/dayz/serverfiles/serverDZ.cfg
|
||||||
|
cd /home/user/dayz/serverfiles
|
||||||
|
./DayZServer -config=serverDZ.cfg
|
||||||
|
```
|
||||||
|
|
||||||
## Configure and Build
|
## Configure and Build
|
||||||
|
|
||||||
|
@ -111,10 +131,24 @@ cd /home/user/dayz/serverfiles
|
||||||
|
|
||||||
## Stop
|
## Stop
|
||||||
|
|
||||||
```docker
|
Hit control c to stop the server in the shell where it's running in the foreground.
|
||||||
# Hit control c to stop the server in the shell where it's running in the foreground.
|
|
||||||
```
|
|
||||||
|
|
||||||
Otherwise, open a new shell in the container and kill the process:
|
Otherwise, open a new shell in the container and kill the process:
|
||||||
|
|
||||||
```docker
|
```docker
|
||||||
|
kill -TERM $(pidof DayZServer)
|
||||||
|
```
|
||||||
|
|
||||||
|
It takes time for the server to wrap things up, so always give it at least 30 seconds to fully shut down.
|
||||||
|
|
||||||
|
If the process does not exit, which it some times does, then you have to kill it:
|
||||||
|
|
||||||
|
```docker
|
||||||
|
kill -KILL $(pidof DayZServer)
|
||||||
|
```
|
||||||
|
|
||||||
|
Otherwise just bring the stack down. That will kill the server process as well:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker compose down
|
||||||
|
```
|
||||||
|
|
|
@ -5,12 +5,16 @@ services:
|
||||||
args:
|
args:
|
||||||
- USER_ID
|
- USER_ID
|
||||||
user: ${USER_ID}
|
user: ${USER_ID}
|
||||||
|
# All container persistence is done using a bind mount that maps to the container's home directory.
|
||||||
|
# Here the default is a directory named dayz in the host user's home directory. Change this to suit your needs.
|
||||||
|
# For proper docker permissions, the host directory must exist before the container first starts and be owned by
|
||||||
|
# the host user.
|
||||||
volumes:
|
volumes:
|
||||||
- ~/dayz:/home/user
|
- ~/dayz:/home/user
|
||||||
|
# The server must run in host mode if you want it to show up on the LAN
|
||||||
network_mode: host
|
network_mode: host
|
||||||
# The above is mutually exclusive with the below. If you don't need
|
# The network_mode above is mutually exclusive with the ports section below. If you don't need the server to show
|
||||||
# the server to show up on the LAN, comment out the network_mode above
|
# up on the LAN, comment out the network_mode above and uncomment the lines below.
|
||||||
# and uncomment the port mappings below.
|
|
||||||
# ports:
|
# ports:
|
||||||
# # Game port
|
# # Game port
|
||||||
# - 2302:2302/udp
|
# - 2302:2302/udp
|
||||||
|
|
Loading…
Add table
Reference in a new issue