An example webserver I wrote for a question on reddit on how to send data from a minecraft server running cc:Tweaked to a webpage.
I included a Dockerfile and two deploy scripts you can use to run it if you don't want to install a bunch of dependencies (besides Docker).
Install node v24 then
cd webserver
npm install
npm start
The default port is 8081
The server will be accessible at http://localhost:8081
Install docker then just do
sudo ./deploy_local.sh
Assuming you have a remote server with ssh access set up and Docker installed on it:
EXAMPLESERVER_KEY=/path/to/your/ssh/key EXAMPLESERVER_HOST=<your-remote-ip> ./deploy_remote.sh
This creates a new docker context using ssh that builds and runs the container on your remote machine.
The server will be accessible at http://<your-remote-ip>:8081
Put the file datasender.lua on your computercraft computer and then do
datasender http://<your-ip>:8081
This will send some fake data every 5 seconds to the web server which will populate in a list on the webpage.
