go-guess/docker-compose.yml

85 lines
2.4 KiB
YAML
Raw Permalink Normal View History

2026-09-19 20:31:14 +02:00
services:
db:
image: postgres:18-alpine
environment:
POSTGRES_DB: go_guess
POSTGRES_USER: go_guess
POSTGRES_PASSWORD: go_guess
2026-10-02 18:50:37 +02:00
networks:
- go_guess_network
2026-09-19 20:31:14 +02:00
ports:
- "${DB_PORT:-5432}:5432"
volumes:
2026-10-01 09:06:58 +02:00
- postgres_data3:/var/lib/postgresql
2026-09-19 20:31:14 +02:00
healthcheck:
test: ["CMD-SHELL", "pg_isready -U go_guess -d go_guess"]
interval: 3s
timeout: 3s
retries: 20
rabbitmq:
image: rabbitmq:4-management-alpine
2026-10-02 18:50:37 +02:00
networks:
- go_guess_network
ports:
- "${RABBITMQ_AMQP_PORT:-5672}:5672"
- "${RABBITMQ_MANAGEMENT_PORT:-15672}:15672"
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 5s
timeout: 5s
retries: 20
2026-09-19 20:31:14 +02:00
api:
build: ./backend
2026-10-03 01:20:14 +02:00
image: batty1039.startdedicated.net:5000/go-guess-api:0.0.1
2026-09-19 20:31:14 +02:00
environment:
DATABASE_URL: postgres://go_guess:go_guess@db:5432/go_guess?sslmode=disable
JWT_SECRET: local-development-secret-change-me-12345
feat: avatar, account menu, and single sign-on from Go Loose Signing in now starts at the sign-in screen and one button that hands the browser to Go Loose, which returns to the welcome page. Nothing redirects to the identity provider on its own any more: that fired on every anonymous visit and read as a redirect loop rather than as a choice to sign in. The password form remains only where the API reports that Go Loose login is not configured for the host, because otherwise the application is unreachable on a bare localhost. A person's picture is carried through from the Go Loose identity and rendered in the account menu and on the profile page, with their initials as the fallback. Two things make that fallback necessary rather than decorative: Go Loose retires a picture key when a picture is replaced, so a link cached in a browser can be dead, and most people have not uploaded one. The URL is deliberately not persisted locally, since a stored key would keep failing after the picture changed. The account menu is a disclosure rather than a hover menu: a real button with aria-expanded, Escape and outside clicks closing it, and focus returning to the trigger. It is not an ARIA menu, because its actions are a link and a button and menuitem roles would strip the link semantics from one of them for no gain. The account URL of the Go Loose identity is resolved on each sign-in and is read from the live identity provider every time, which is also what makes it correct after a picture change. Depends on the Go Loose revision that serves avatar_url through /connect/userinfo, so the picture URL reaches this application at all.
2026-10-05 21:50:06 +02:00
FRONTEND_URL: ${FRONTEND_URL:-https://nmbs.guess-dev.urpi.be}
feat: palette and light/dark from go-bananas, and fix the image user The theme selector and the appearance toggle are the custom elements go-bananas ships, loaded at run time. They are custom elements rather than components written here because the applications this service feeds are a mix of React, vanilla JavaScript and server-rendered HTML, and a custom element is the one shape all three can use with no build step, no import map, and no second copy of React to break the hooks. Every token in the stylesheet is now written as var(--bn-*, fallback). That ordering is the safety property: with no theme service configured the page renders exactly as it did before, and with one configured the same rules follow the palette. The navigation rail takes the contract's sunken surface and its paired foreground rather than a fixed dark navy, because a light appearance wants dark text there. THEME_BASE_URL is read from runtime-config.js, which the entrypoint rewrites from the environment on start, so one image serves every environment rather than baking a hostname into the bundle at build time. contract.test.ts fetches the live contract and asserts it defines every --bn-* variable this application consumes. A token renamed on the service would otherwise leave every var() resolving to its fallback, and the page would look correct while never actually following the palette. Verified it fails on a deliberately wrong token name. The image also had two USER lines, the second silently replacing the first with a uid that owns neither /app nor /tmp/nginx. nginx could not create its pid file or its temp paths, so the container failed to start. Confirmed by building both variants: the old one cannot write nginx's temp directory, the fixed one serves the front end, its hashed assets, and the /api proxy.
2026-10-05 22:47:20 +02:00
# Where the go-bananas styling contract is served from. Empty disables it.
THEME_BASE_URL: ${THEME_BASE_URL:-}
APP_ENV: ${APP_ENV:-development}
feat: avatar, account menu, and single sign-on from Go Loose Signing in now starts at the sign-in screen and one button that hands the browser to Go Loose, which returns to the welcome page. Nothing redirects to the identity provider on its own any more: that fired on every anonymous visit and read as a redirect loop rather than as a choice to sign in. The password form remains only where the API reports that Go Loose login is not configured for the host, because otherwise the application is unreachable on a bare localhost. A person's picture is carried through from the Go Loose identity and rendered in the account menu and on the profile page, with their initials as the fallback. Two things make that fallback necessary rather than decorative: Go Loose retires a picture key when a picture is replaced, so a link cached in a browser can be dead, and most people have not uploaded one. The URL is deliberately not persisted locally, since a stored key would keep failing after the picture changed. The account menu is a disclosure rather than a hover menu: a real button with aria-expanded, Escape and outside clicks closing it, and focus returning to the trigger. It is not an ARIA menu, because its actions are a link and a button and menuitem roles would strip the link semantics from one of them for no gain. The account URL of the Go Loose identity is resolved on each sign-in and is read from the live identity provider every time, which is also what makes it correct after a picture change. Depends on the Go Loose revision that serves avatar_url through /connect/userinfo, so the picture URL reaches this application at all.
2026-10-05 21:50:06 +02:00
GO_LOOSE_AUTH_DOMAIN: ${GO_LOOSE_AUTH_DOMAIN:-auth-dev.urpi.be}
GO_LOOSE_APP_DOMAIN: ${GO_LOOSE_APP_DOMAIN:-guess-dev.urpi.be}
GO_LOOSE_CA_FILE: /certs/local-ca.crt
GO_LOOSE_NMBS_CLIENT_ID: ${GO_LOOSE_NMBS_CLIENT_ID:-}
GO_LOOSE_NMBS_CLIENT_SECRET: ${GO_LOOSE_NMBS_CLIENT_SECRET:-}
GO_LOOSE_YPTO_CLIENT_ID: ${GO_LOOSE_YPTO_CLIENT_ID:-}
GO_LOOSE_YPTO_CLIENT_SECRET: ${GO_LOOSE_YPTO_CLIENT_SECRET:-}
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/
2026-10-02 21:44:26 +02:00
expose:
- "8080"
2026-10-02 18:50:37 +02:00
networks:
- go_guess_network
2026-10-02 21:44:26 +02:00
- local_dev_edge
volumes:
feat: avatar, account menu, and single sign-on from Go Loose Signing in now starts at the sign-in screen and one button that hands the browser to Go Loose, which returns to the welcome page. Nothing redirects to the identity provider on its own any more: that fired on every anonymous visit and read as a redirect loop rather than as a choice to sign in. The password form remains only where the API reports that Go Loose login is not configured for the host, because otherwise the application is unreachable on a bare localhost. A person's picture is carried through from the Go Loose identity and rendered in the account menu and on the profile page, with their initials as the fallback. Two things make that fallback necessary rather than decorative: Go Loose retires a picture key when a picture is replaced, so a link cached in a browser can be dead, and most people have not uploaded one. The URL is deliberately not persisted locally, since a stored key would keep failing after the picture changed. The account menu is a disclosure rather than a hover menu: a real button with aria-expanded, Escape and outside clicks closing it, and focus returning to the trigger. It is not an ARIA menu, because its actions are a link and a button and menuitem roles would strip the link semantics from one of them for no gain. The account URL of the Go Loose identity is resolved on each sign-in and is read from the live identity provider every time, which is also what makes it correct after a picture change. Depends on the Go Loose revision that serves avatar_url through /connect/userinfo, so the picture URL reaches this application at all.
2026-10-05 21:50:06 +02:00
- ${LOCAL_CA_FILE:-/home/dnoulet/go/infrastructure/certs/local-ca.crt}:/certs/local-ca.crt:ro
2026-09-19 20:31:14 +02:00
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
2026-09-19 20:31:14 +02:00
web:
build: ./frontend
2026-10-03 01:20:14 +02:00
image: batty1039.startdedicated.net:5000/go-guess-web:0.0.1
2026-10-02 21:44:26 +02:00
expose:
- "80"
2026-09-19 20:31:14 +02:00
depends_on:
- api
2026-10-02 18:50:37 +02:00
networks:
2026-10-02 21:44:26 +02:00
go_guess_network: {}
local_dev_edge:
aliases:
- go-guess-web
2026-10-02 18:50:37 +02:00
networks:
go_guess_network:
2026-10-02 21:44:26 +02:00
local_dev_edge:
external: true
name: local-dev-edge
2026-09-19 20:31:14 +02:00
volumes:
postgres_data:
2026-10-01 09:06:58 +02:00
postgres_data2:
postgres_data3: