nighthawkcoders / teacher_portfolio

GitHub Pages / Jupyter Notebook guides for Python, Java, JavaScript, Linux
https://nighthawkcoders.github.io/teacher_portfolio/
Apache License 2.0
1 stars 50 forks source link

CSSE Multiplayer Features, Server Deployment #72

Open jm1021 opened 6 months ago

jm1021 commented 6 months ago

Assigned

Trystan, Mathew, Ian, Gavin I

Brain write Teacher

Key server concepts

jm1021 commented 6 months ago

Key features multiuser ....

Key Code ownership and Expertise

jm1021 commented 5 months ago

docker-compose install

sudo apt update
sudo apt install docker-compose -y
sudo usermod -aG docker ${USER}

clone github repo

$ git clone https://github.com/Trystan-Schmits/Multiplayer.git

start server

cd /home/ubuntu/Multiplayer/node_backend
cp Docker-compose.yml  docker-compose.yml
docker-compose up -d --build
docker ps

internet access for websocket server

setup domain

use AWS route 53 to domain authority

Record name: platformer.nighthawkcodingsociety.com
Record type: A
Value: 18.220.83.242
Alias: No
TTL (seconds): 300
Routing policy: Simple

install nginx

use nginx as reverse proxy service

sudo apt install nginx

install certbot

use certbot as certificate authority for https

sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot

setup reverse proxy configuration file

server {
    server_name platformer.nighthawkcodingsociety.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

activate nginx

activate platformer configuration and sign

sudo ln -s /etc/nginx/sites-available/platformer /etc/nginx/sites-enabled/
sudo certbot --nginx
jm1021 commented 5 months ago

docker-compose update

the steps to update are focussed on stopping, updating, and rebuilding node backend service

cd ~/Multiplayer/node_backend
git pull
docker-compose down
docker-compose build --no-cache
docker-compose up -d