-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathunraid_template.xml
142 lines (142 loc) · 8.53 KB
/
unraid_template.xml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0"?>
<Container version="2">
<Name>Foundry</Name>
<Repository>luxusburg/docker-foundry:latest</Repository>
<Registry>https://hub.docker.com/r/luxusburg/docker-foundry</Registry>
<Network>bridge</Network>
<Shell>sh</Shell>
<Privileged>false</Privileged>
<Support/>
<Project>https://github.com/luxusburg/docker-foundry</Project>
<Overview># Docker for a Foundry dedicated server
[![Docker Pulls](https://img.shields.io/docker/pulls/luxusburg/docker-foundry)](https://hub.docker.com/r/luxusburg/docker-foundry)

[![Image Size](https://img.shields.io/docker/image-size/luxusburg/docker-foundry/latest)](https://hub.docker.com/r/luxusburg/docker-foundry/tags)

[![Docker Hub](https://img.shields.io/badge/Docker_Hub-foundry-blue?logo=docker)](https://hub.docker.com/r/luxusburg/docker-foundry)

This is a Docker container to help you get started with hosting your own [Foundry](https://www.paradoxinteractive.com/games/foundry/about) dedicated server.

This Docker container has been tested and will work on the following OS:

- Linux (Ubuntu/Debian)

This is my first Docker image ever created I am always open to improving it! 

&gt; [!TIP]
&gt; Add environment variables so that you can for example change the password of the server
&gt; On the bottom you will find a list of all environment variables to change, if you want to use your own app.cfg file
&gt; set the CUSTOM_CONFIG to true
&gt; Here are all the possible changes from the devs [link](https://dedicated.foundry-game.com/) 

## Docker Run

**This will create the folders './server' and './data' in your current folder where you execute the code**

**Recommendation:**
Create a folder before executing this docker command

To deploy this docker project run:

```bash
docker run -d \
--name foundry \
-p 3724:3724/udp \ 
-p 27015:27015/udp \
-v ./server:/mnt/foundry/server \
-v ./data:/mnt/foundry/persistentdata \
-e TZ=Europe/Paris \
-e SERVER_PWD=change_me
-e SERVER_NAME='Foundry docker by Luxusburg'
-e PAUSE_SERVER_WHEN_EMPTY=false
luxusburg/docker-foundry:latest
```

## Docker compose Deployment

**This will create the folders './server' and './data' in your current folder where you execute combose file**

**Recommendation:**
Create a folder before executing the docker compose file

&gt; [!IMPORTANT]
&gt; Older docker compose version needs this line before the **services:** line
&gt;
&gt; version: '3'

```yml
services:
foundry:
container_name: foundry
image: luxusburg/docker-foundry:latest
network_mode: bridge
environment:
- TZ=Europe/Paris
- SERVER_PWD=change_me
- SERVER_NAME='Foundry docker by Luxusburg'
- PAUSE_SERVER_WHEN_EMPTY=false
volumes:
- './server:/mnt/foundry/server:rw'
- './data:/mnt/foundry/persistentdata:rw'
ports:
- '3724:3724/udp'
- '27015:27015/udp'
```

## Backup &amp; recovery

Backups are all saved in the folder you set in your volume for `/location/of/folder:/mnt/foundry/persistentdata`
There should be a folder in it called `backup`.

Per Default backups are activated and done every hour of the day you can change this by looking at the environment variables further below.

&gt; [!IMPORTANT]
&gt; This command will overwrite your current save files! **Copy/backup the files before overwriting them!**

If you want to recover a backup you need to stop the container and unzip the files into your folder `/location/of/folder` with this command for example
`tar -xzvf /location/of/folder/backup/foundry-backup-DATE_AND_TIME_OF_BACKUP_YOU_WANT_TO_USE.tar.gz -C /location/of/folder/`


## Environment variables Game settings

You can use these environment variables for your game settings:

| Variable | Key | Description |
| -------------------- | ---------------------------- | ------------------------------------------------------------------------------- |
| TZ | Europe/Paris | timezone |
| WORLD_NAME | optional save name for map | Sets the server world name. This is the folder where the save files will be stored. |
| SERVER_PWD | optional password | Sets the server password. |
| PAUSE_SERVER_WHEN_EMPTY | optional: true or false | Will the server pause when nobody is connected. |
| AUTOSAVE_INTERVAL | optional in seconds | Sets the autosave frequency in seconds. |
| SERVER_IS_PUBLIC | optional: true of false | Sets whether the server is listed on the Steam server browser. |
| SERVER_PORT | optional | Sets the network port used by the game. Default is 3724. |
| SERVER_QUERY_PORT | optional | Sets the network port used by the Steam server browser to query information about the game. This is only used if the server is set to public. Default is 27015. |
| SERVER_NAME | optional | This is the name of the server listed in the Steam server browser. |
| MAP_SEED | optional | Sets the map seed used to generate the world. |
| SERVER_MAX_PLAYERS | optional | This sets the max amount of players on a server. |
| MAX_TRANSFER_RATE | optional default: 1024 max: 8192 | Change transfer rate of the server data |
| CUSTOM_CONFIG | optional: true of false | Set this to true if the server should only accept you manual adapted app.cfg file |

## Environment variables Backup settings

&gt; [!WARNING]
&gt; For BACKUP_INTERVAL **do not set double or single quotes** : `""` or `''`

| Variable | Key | Description |
| -------------------- | ---------------------------- | ------------------------------------------------------------------------------- |
| BACKUPS | true (default) or false | Activate backups |
| BACKUP_INTERVAL | default: 0 * * * * | [Cron schedule](https://en.wikipedia.org/wiki/Cron#Overview) value for the backups |
| BACKUP_RETENTION | default: 30 min: 1 |Sets how many days the backups should be kept |</Overview>
<Category>GameServers:</Category>
<Icon/>
<DateInstalled>1715847941</DateInstalled>
<Config Name="server_files" Target="/home/foundry/server_files" Default="/mnt/user/appdata/foundry/server_files" Mode="rw" Description="" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/foundry/server_files</Config>
<Config Name="persistent_data" Target="/home/foundry/persistent_data" Default="/mnt/user/appdata/foundry/persistent_data" Mode="rw" Description="" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/foundry/persistent_data</Config>
<Config Name="SERVER_NAME" Target="SERVER_NAME" Default="Foundry docker by Luxusburg" Mode="" Description="This is the name of the server listed in the Steam server browser." Type="Variable" Display="always" Required="false" Mask="false">Foundry docker by Luxusburg</Config>
<Config Name="SERVER_IS_PUBLIC" Target="SERVER_IS_PUBLIC" Default="true|false" Mode="" Description="Sets whether the server is listed on the Steam server browser." Type="Variable" Display="always" Required="false" Mask="false">false</Config>
<Config Name="WORLD_NAME" Target="WORLD_NAME" Default="" Mode="" Description="" Type="Variable" Display="always" Required="false" Mask="false">MyFancyFactory</Config>
<Config Name="MAP_SEED" Target="MAP_SEED" Default="" Mode="" Description="" Type="Variable" Display="advanced-hide" Required="false" Mask="false">123456789</Config>
<Config Name="SERVER_PORT" Target="SERVER_PORT" Default="3724" Mode="udp" Description="Sets the network port used by the game. Default is 3724." Type="Port" Display="advanced-hide" Required="false" Mask="false">3724</Config>
<Config Name="SERVER_QUERY_PORT" Target="SERVER_QUERY_PORT" Default="27015" Mode="udp" Description="Sets the network port used by the Steam server browser to query information about the game. This is only used if the server is set to public. Default is 27015." Type="Port" Display="advanced-hide" Required="false" Mask="false">27015</Config>
<Config Name="PAUSE_SERVER_WHEN_EMPTY" Target="PAUSE_SERVER_WHEN_EMPTY" Default="true|false" Mode="" Description="Will the server pause when nobody is connected." Type="Variable" Display="advanced-hide" Required="false" Mask="false">true</Config>
</Container>