-
Notifications
You must be signed in to change notification settings - Fork 0
Container Deployment
You will need...
- podman
- buildah
- a Linux environment (Windows is untested, and will not receive support)
- 1GB of RAM
- 10GB of storage
This guide was created using Fedora 37, older versions of podman and buildah may not work the same. Ensure that SELinux is disabled until the container is created and deployed.
This will clean ALL containers and images from podman and buildah
podman stop -a
podman container rm -a
podman image rm -a
buildah rmi -a
buildah rm -a
This script will download, compile and install Reywen to the container. It may take a while as Rust has very strong rules for compilation. Once completed your container is complete and ready for deployment.
buildah from rust
buildah run rust-working-container wget https://raw.githubusercontent.com/toastxc/Reywen-Revolt/main/.podman/debian.sh
# run again to test if the server works, you should get a 'Websocket protocl' Error
buildah run rust-working-container sh debian.sh
####################################
buildah config --entrypoint "sh debian.sh -D FOREGROUND" rust-working-container
buildah commit rust-working-container reywen
This example is based on the official bot's implementation
How a container is deployed is up to you, but here's a basic guideline for deployment. There are two important parts of this command, the pod and the volume. It is recommended to run Reywen in a pod so that it can connect to MongoDB for database functionality. the volume is used for modifying configurations for both reywen and its plugins.
A pod is a collection of containers, it is required for Reywen if you intend to connect to any database or similar service. By default secure websocket operates over port 443 but since this is a privileged port non-root podman cannot use it. In the example below internal 443 is port mapped to 1086.
podman pod create \
--name reywen \
-p 1086:443
dir=$( echo "/home/"$USER"/Downloads/reywen")
podman run -d -it \
--name reywen-server \
-v $dir/config:/config \
--pod reywen \
localhost/reywen
It is very important to save the password and username of MongoDB so that it can be added in Reywen configurations once deployed. The MongoDB container is only required for plugins, for minimal instances this and the pod are not needed!!
podman run -d \
-p 27017:27017 --name reywen-mongodb \
-v /mnt/raid/reywen/db:/data/db \
-e MONGO_INITDB_ROOT_USERNAME=reywen \
-e MONGO_INITDB_ROOT_PASSWORD=PASSWORD \
mongo