Skip to content

Commit a1f8283

Browse files
authored
Adding headless docker compose (#98)
* Add Autoheal and avatarfile loading. * Add memory limit, and volume mounting instead of using native os filesystem. * Correction in wording. * Adds some insight in steps. * More detail on scaling.
1 parent 0a03fef commit a1f8283

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

content/docs/server/headless.mdx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Make a folder for the `docker-compose.yml` and copy the example below.
6565
Start a Command Prompt or Powershell in that directory. When using file explorer you can launch Command Prompt by typing `cmd.exe` in the url bar or explorer.
6666
</Step>
6767
<Step>
68-
First download/update the docker images with `docker compose pull`
68+
First download/update the docker images with `docker compose pull` *Not required if using the default `docker-compose.yml`*
6969
</Step>
7070
<Step>
7171
Type the command `docker compose up -d` to start the containers
@@ -76,7 +76,7 @@ Use `docker ps` to see the health of all containers and wait until all say healt
7676
<Step>
7777
Use `docker compose scale "basis-headless=#` to increase the number of containers. Than go back to a step and repeat until either you out of CPU or RAM.
7878

79-
*Replace `#` with a number in increments of 5*
79+
*Replace `#` with a number in increments of 5 at most, use increments of 1 on lower end/Ram limited hardware*
8080

8181
<Callout type="info">
8282
You can also measure usage with `docker compose stats`
@@ -98,7 +98,7 @@ By Default use the linux version of the docker image as its built using IL2CPP a
9898
services:
9999
basis-headless:
100100
image: ghcr.io/basisvr/basis-headless:nightly-linux
101-
scale: 3 # You should change based on how much RAM you have. 1.5GB per instance is normally required.
101+
pull_policy: always
102102
environment:
103103
Port: 4296
104104
Password: default_password
@@ -110,15 +110,21 @@ services:
110110
AvatarFileLocation: ""
111111
AvatarPassword: ""
112112
volumes:
113-
- ./Basis:/root/.config/unity3d/Basis Unity/Basis Unity # For Sharing Cached files. Optional not required
114-
- "${APPDATA}/../LocalLow/Basis Unity/Basis Unity:/root/.config/unity3d/Basis Unity/Basis Unity" # If you want to use your own cache and avatar files. *Corruption possible
113+
- Basis:/root/.config/unity3d/Basis Unity/Basis Unity # For Sharing Cached files. If running on Windows you should do it this way.
114+
- "${APPDATA}/../LocalLow/Basis Unity/Basis Unity:/root/.config/unity3d/Basis Unity/Basis Unity" # If you want to use your own cache and avatar files. Slower on Windows as its having the overhead from WSL2 *Corruption possible
115115
- ./config.xml:/app/HeadlessLinuxServer_Data/config.xml # Optional will be overridden when using environment variables
116116
healthcheck:
117117
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:10666/health"]
118118
interval: 30s
119119
timeout: 5s
120120
retries: 3
121121
start_period: 20s
122+
deploy:
123+
resources:
124+
limits:
125+
memory: 4096M #Highest I ever saw we need to load a 500MB world file.
126+
reservations:
127+
memory: 1024M #Recommend amount that basis will actually need.
122128
labels:
123129
autoheal-app: true
124130
autoheal:
@@ -129,6 +135,8 @@ services:
129135
AUTOHEAL_CONTAINER_LABEL: autoheal-app
130136
volumes:
131137
- /var/run/docker.sock:/var/run/docker.sock
138+
volumes:
139+
Basis:
132140
```
133141
134142
## What the Settings Mean

0 commit comments

Comments
 (0)