Give it a container and a page of its own

A Dockerfile that builds the bundle and serves it from nginx, matching the
three games already on the site, and the metadata a page needs when it is
somewhere rather than on a laptop: canonical, Open Graph, the two JSON-LD
blocks, and a noscript that describes the game rather than showing an empty
div to anybody who does not run scripts.

No dev proxy, unlike its siblings. They post scores to a shared service and
this one has nothing to post: a game of Diplomacy is not a number, and a
leaderboard reading "reached eleven centres" would be a worse thing to know
about somebody than nothing at all.

The favicon is seven powers round a board in the seven colours the map uses,
with the one supply centre in the middle they are all looking at -- drawn
here rather than drafted in a tool, like every other mark in this
repository.

And a way back out, absolute rather than "/": this is served from a
subdirectory in production and from the root in development, so the relative
answer is right in one of those and points at the game itself in the other.
This commit is contained in:
2026-09-09 12:00:51 -07:00
parent c6c3b926d2
commit e615726615
7 changed files with 198 additions and 14 deletions
+5 -12
View File
@@ -4,21 +4,14 @@ import { defineConfig } from 'vite'
// Vitest is left on its defaults on purpose: it already picks up *.test.ts and
// nothing else, and importing `vitest/config` here drags in a second copy of
// vite whose plugin types disagree with this one's.
//
// There is no dev proxy here, unlike this game's siblings. They post scores to
// a shared service; this one has nothing to post. A game of Diplomacy is not a
// number, and a leaderboard reading "reached eleven centres" would be a worse
// thing to know about somebody than nothing at all.
export default defineConfig({
// Asset URLs are baked in at build time, so this has to match the path the
// game is served from. Local development stays at the root.
base: process.env.BASE_PATH ?? '/',
plugins: [react()],
server: {
// The game talks to /api in every environment; in production that is
// nginx in front of the shared scores container. In development, run
// https://github.com/Coffey-Labs/games-scores alongside this -- or do not,
// and the board will say so rather than breaking.
proxy: {
'/api': {
target: process.env.SCORES_TARGET ?? 'http://localhost:5184',
changeOrigin: true,
},
},
},
})