|
smollerGraph 0.20.2
A small graph database, from scratch
|
Accepted
Up to episode 8, smollerGraph's page ran at localhost, "where nobody else can open it", with sg serve sending the page's files and answering the API, published on port 8474 from a container. Episode 8 put it on a server.
deploy.sh takes the server as a user at an address, such as ./deploy.sh debian@203.0.113.7. It sends the committed files of HEAD over SSH, as a tar stream from git archive, into ~/smollergraph, after removing the old copy, and runs docker compose up -d --build --wait there, which builds the image and swaps the running containers for new ones.compose.yaml runs two containers, each restarted unless it was stopped, so they come back when the server reboots. web is Caddy 2.10.2 on Alpine, the only one published, which serves the ui folder on port 8474 and passes /api/ on to sg. sg runs sg serve on the network the two share. The episode's reason: "On a server, it's usual to split those up", and Caddy serves the files "as a web server is built to".sg serve sending the page and answering the API on the server's port, as it did on a laptop from episode 4, and in ep008/step-1.git archive packs what's committed, so a change that isn't committed doesn't reach the server, and removing the old folder first means a file deleted from the repo doesn't stay behind.compose.friends.yaml serves the generated friends in their place (episode 13).sg serve send the page's files with Cache-Control: no-cache, so a browser asks for them again after an upgrade (episode 10).