This is the lazy version of the Docker guide (WiP), for people who don't understand what they are doing at all, or simply don't want to read and think, and just want to copy-paste few commands and be done with it
For ArchLinux-based systems you can find installation instructions on the ArchWiki, for everyone else: official docs.
Short version of Arch instruction:
-
Install
sudo pacman -S docker sudo systemctl enable --now docker.service -
Verify it's working
docker info
-
You will see permission errors at the end - add yourself to
dockergroup and then log out and log back in for changes to take effectsudo usermod -aG docker YOUR_USERNAME
Pick a location to store the server data, such as ~/peacock_server (commands below assume that to be the case)
Download latest release from Github (pick the -linux archive).
Unzip it and copy contents of the directory inside of the archive into the path you picked before.
Assuming you have curl and unzip installed, you can run the following commands to do the above:
-
Setup
PEACOCK_VERSION=$(curl -sS https://api.github.com/repos/thepeacockproject/peacock/releases/latest | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p') PEACOCK_DIR="Peacock-$PEACOCK_VERSION-linux" mkdir -p ~/peacock_server/tmp
-
Download latest release
curl -LO --output-dir ~/peacock_server/tmp "https://github.com/thepeacockproject/Peacock/releases/download/$PEACOCK_VERSION/$PEACOCK_DIR.zip"
-
Extract it and copy the files into the server dir
unzip -d ~/peacock_server/tmp ~/peacock_server/tmp/$PEACOCK_DIR.zip cp -a ~/peacock_server/tmp/$PEACOCK_DIR/* ~/peacock_server
-
Save current version for later use
echo $PEACOCK_VERSION > ~/peacock_server/peacock_version
-
Cleanup
rm -rf ~/peacock_server/tmp unset PEACOCK_VERSION PEACOCK_DIR
Execute command below (change 4747 to something else if you want to use a different port on your machine for the server)
docker run -d \
--name peacock_server \
--volume ~/peacock_server:/app \
--workdir /app \
--publish "4747:3000" \
--env PORT=3000 \
--user $(id -u):$(id -g) \
"node:$(sed 's/^v\([0-9]*\).*/\1/' ~/peacock_server/.nvmrc || echo lts)-alpine" \
chunk0.jsAbove will start the docker container in the background (so command will exit as soon as it is started, without taking over the terminal),
as your user (so you have rights to access its data, such as userdata or plugins),
mount the directory with the server into the container,
"publish" (as in connect) port 4747 of your computer to port we start server on in the container
Warning
If you run the command above multiple times and encounter an error about name being already taken - run
docker rm -f peacock_serverto get rid of the old container before running thedocker runagain.
Check that server started without issues by checking its logs - you should see logs ending with something along the lines of
[14:07:12:412] [Info | boot] Booting Peacock internal services - this may take a moment.
[14:07:12:620] [Debug | scanGroups] Discovered 165 escalation groups.
[14:07:12:863] [Info] Server started.
[14:07:17:646] [Debug | updates] Peacock is up to date.
As you have direct access to the contents of Peacock directory, the configuration largely follows the official guide.
It's recommended to stop container before making any modifications, and start it back afterwards
You can check the status of running containers with
docker ps -awhich will get the output along the lines of
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7cfe67b265be node:20-alpine "docker-entrypoint.s…" 2 hours ago Up 3 seconds 0.0.0.0:4747->3000/tcp, :::4747->3000/tcp peacock_server
With NAMES at the end being the name of the container, STATUS being "Up" if container is running and "Exited" if it is stopped, and PORTS (only shows up if container is running) allowing you to recall which port you should write in Patcher
If you see "Restarting" in the status, over an over, that means something went catastrophically wrong and container can't start. Check the logs.
When you have executed docker run above, you have created and started the container.
To merely start already exisitng container, use
docker start peacock_serverAnd to stop:
docker stop peacock_serverAs it is configured now, Peacock server will need to be started and stopped manually (for example, before starting the game, and after qutting it).
If you want the server to run always in the background (it takes about ~90MB of RAM and nonexistent CPU cycles amount), you can change its "restart policy" to have it start on system boot automatically:
docker update --restart unless-stopped peacock_serverTo only restart in case of a failure:
docker update --restart on-failure peacock_serverAnd the default behaviour, the way it was set up originally, fully manual lifecycle:
docker update --restart no peacock_serverFirst, you can check the current and latest Peacock versions with
echo "Peacock version: $(cat ~/peacock_server/peacock_version), latest: $(curl -sS https://api.github.com/repos/thepeacockproject/peacock/releases/latest | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p')"If you want to update - stop and get rid of the current container
docker stop peacock_server
docker rm peacock_serverThen re-run the steps from get peacock and run the container.
To access CLI tools of Peacock server, you can execute (press Ctrl-C to exit):
docker exec -it peacock_server node chunk0.js toolsTo simply print out logs to the terminal run
docker logs peacock_serverTo follow (have them be printed out in real time) logs, execute (press Ctrl-C to exit):
docker logs -tf peacock_server