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
29 lines (27 loc) · 749 Bytes
/
valheim.service
File metadata and controls
29 lines (27 loc) · 749 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
28
29
[Unit]
Description=Valheim Server
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
EnvironmentFile=-/etc/sysconfig/valheim-server
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull lloesche/valheim-server
ExecStart=/usr/bin/docker run \
--name %n \
--rm \
-v /etc/valheim:/config:Z \
-v /opt/valheim:/opt/valheim:Z \
-p 2456-2458:2456-2458/udp \
-e SERVER_NAME \
-e SERVER_PORT \
-e WORLD_NAME \
-e SERVER_PASS \
-e SERVER_PUBLIC \
lloesche/valheim-server
ExecStop=/usr/bin/docker stop %n
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target