forked from community-valheim-tools/valheim-server-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalheim.service
More file actions
27 lines (25 loc) · 707 Bytes
/
valheim.service
File metadata and controls
27 lines (25 loc) · 707 Bytes
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
[Unit]
Description=Valheim Server
After=docker.service
Requires=docker.service
ConditionPathExists=/etc/sysconfig/valheim-server
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStart=/usr/bin/docker run \
--name %n \
--pull=always \
--rm \
--cap-add=sys_nice \
--stop-timeout 120 \
-v /etc/valheim:/config:Z \
-v /opt/valheim:/opt/valheim:Z \
-p 2456-2457:2456-2457/udp \
--env-file /etc/sysconfig/valheim-server \
ghcr.io/lloesche/valheim-server
ExecStop=/usr/bin/docker stop %n
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target