2020-07-24 07:53:22 +01:00
# Run this image
2020-08-18 11:32:03 +01:00
To run this image you can use `docker run -pd 42420:42420 --name VintageStoryServer devidian/vintagestory` , but you may want to use a customized version for your needs so see following instructions.
2020-07-24 07:53:22 +01:00
2020-08-18 06:57:36 +01:00
# Custom build
You can either copy files from `https://github.com/Devidian/docker-vintagestory/tree/master/build-custom-example` or follow these steps:
- create a `serverconfig.json` with your settings
2020-08-18 07:20:45 +01:00
- create a `Dockerfile` file with contents found below
- create a `docker-compose.yml` file with contents found below (adjust port/path if you need)
2020-08-18 06:57:36 +01:00
- run `docker-compose up -d` to start
- run `docker-compose up -d --build` to rebuild and restart
- run `docker-compose down` to stop
2020-08-23 14:27:54 +01:00
We use `vs_data_path` as ARG because ENV did not get overridden in build phase and we use `VS_DATA_PATH` as ENV because ARG in CMD is empty.
2020-08-18 06:57:36 +01:00
## Dockerfile for custom-build
```docker
# ============== runtime stage ==================
FROM devidian/vintagestory:latest as runtime
2020-08-20 08:37:34 +01:00
ARG vs_data_path=/gamedata/vs
2020-08-18 06:57:36 +01:00
# update with your own serverconfig
2020-08-20 08:37:34 +01:00
COPY serverconfig.json ${vs_data_path}/serverconfig.json
# copy mods
#COPY Mods ${vs_data_path}/Mods/
# copy default player data
#COPY Playerdata ${vs_data_path}/Playerdata/
WORKDIR /game
2020-08-18 06:57:36 +01:00
2020-08-23 14:27:54 +01:00
CMD mono VintagestoryServer.exe --dataPath ${VS_DATA_PATH}
2020-08-18 06:57:36 +01:00
```
## docker-compose.yml
```yml
version: '3.1'
services:
vsserver:
2020-08-20 08:37:34 +01:00
build:
context: .
args:
2020-08-23 14:27:54 +01:00
vs_data_path: /gamedata/vs-custom/
2020-08-18 06:57:36 +01:00
container_name: vsserver
restart: always
volumes:
- gamedata:/gamedata
ports:
2020-08-18 07:20:45 +01:00
- 42420:42420
2020-08-23 14:27:54 +01:00
environment:
VS_DATA_PATH: /gamedata/vs-custom
2020-08-18 06:57:36 +01:00
volumes:
gamedata:
```
# using unstable versions
to use unstable versions just replace tag `latest` with `unstable` in `Dockerfile`