Sanae6 / SmoOnlineServer

Official server for Super Mario Odyssey: Online
https://discord.gg/jYCueK2BqD
103 stars 24 forks source link

Add Dockerfile and Fly.io deployment instructions #9

Open sawyerknoblich opened 2 years ago

sawyerknoblich commented 2 years ago

Adds a Dockerfile and instructions for deploying to the free tier of Fly.io for anybody who wants to run the server but isn't familiar with the operations-side of software development.

I saw that #6 also adds a Dockerfile, but that PR seems more focused on 1. pushing an image to an external registry 2. running that pushed image locally. This PR is intended for people who maybe aren't comfortable or knowledgable about provisioning their own server and setting everything up manually, but could follow the doc I've added to run the server for free on a platform that will keep it running automatically and give easy access to server logs. There definitely is some overlap between this PR and #6 though, so feel free to combine this with that one or close this if it's out of scope.

Istador commented 2 years ago
  1. pushing an image to an external registry

I'd not describe the GitHub Container Registry (GHCR) as an external registry, but rather internal. Because we're on GitHub here and the images will be connected with this repository. (I'd rather say DockerHub is a external registry.)

Though from the perspective of the fly.io runtime, it'd be a external registry.

  1. running that pushed image locally.

The focus is on building and providing docker images automatically on code changes, that are ready to use for all kind of different docker use cases (locally, on a server, on an embedded device, in a cloud, whatever).

The docker-compose.yml and the commands in the readme are just examples on how to use the images.

I'm no expert with fly.io and can't test it without a credit card, but you might be able to instruct flyctl launch with --image to use an already existing image for the application instead of building it from scratch. Untested example:

flyctl launch --image ghcr.io/istador/smo-online-server
sawyerknoblich commented 2 years ago

I'd not describe the GitHub Container Registry (GHCR) as an external registry, but rather internal.

Ah yeah iffy wording on my part, I more just meant "as opposed to building the image locally", but I suppose just calling it "a registry" would have been better.

  1. running that pushed image locally.

My focus on this PR compared to #6 was more about the documentation rather than the possibilities of what you could do with the image. The main goal of this PR was to teach a relatively easy way to deploy the server, and yes it would definitely be even easier if using a pre-built image from GHCR.

use an already existing image for the application instead of building it from scratch

I did just test flyctl deploy --image ghcr.io/istador/smo-online-server:latest and it looks like that deployed successfully, so I'd be more than happy to cut a few steps out of my doc once your PR is merged. This is why I added the disclaimer at the end of my description about there being some overlap between my PR and yours, maybe it's better for this one to wait for yours to be merged and then the only thing mine adds is the new doc.