From 61589a2fe6445db7fb7a3353a402cfa788a004bf Mon Sep 17 00:00:00 2001 From: sh-agents <350651734+sh-agents@users.noreply.github.com> Date: Sun, 1 Nov 2026 15:27:04 +0000 Subject: [PATCH] scripts: deploy the badges and names sites --- scripts/store-service/.gitignore | 3 ++- scripts/store-service/Dockerfile | 8 +++---- scripts/store-service/compose.yml | 3 ++- .../store-service/store_service.ini.example | 22 ++++++++++++------- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/scripts/store-service/.gitignore b/scripts/store-service/.gitignore index 78d3246083..606cf0ab66 100644 --- a/scripts/store-service/.gitignore +++ b/scripts/store-service/.gitignore @@ -1,4 +1,5 @@ .env config/ data/ -web/ +badges/ +names/ diff --git a/scripts/store-service/Dockerfile b/scripts/store-service/Dockerfile index a08832e786..abfdc0365a 100644 --- a/scripts/store-service/Dockerfile +++ b/scripts/store-service/Dockerfile @@ -9,9 +9,9 @@ ARG CABAL=3.10.2.0 ARG NODE=24 # The checkout page's dist/ is gitignored, so this stage builds it. -FROM node:${NODE}-bookworm-slim AS web +FROM node:${NODE}-bookworm-slim AS badges -WORKDIR /web +WORKDIR /badges COPY apps/simplex-store-service/web/package.json apps/simplex-store-service/web/package-lock.json ./ RUN npm ci COPY apps/simplex-store-service/web ./ @@ -81,12 +81,12 @@ RUN if existing_user=$(getent passwd ${USER_UID} | cut -d: -f1) && [ -n "${exist useradd -u ${USER_UID} -g ${USER_GID} -m -d /home/badge badge COPY --from=build /out/simplex-store-service /usr/local/bin/simplex-store-service -COPY --from=web /web/dist /srv/web +COPY --from=badges /badges/dist /srv/badges USER badge WORKDIR /home/badge -EXPOSE 8080 +EXPOSE 8080 8081 # There is no HEALTHCHECK because the listener answers before the chat side has an address, so it # would report healthy too early. diff --git a/scripts/store-service/compose.yml b/scripts/store-service/compose.yml index 5aaa5c704b..5644ee6f96 100644 --- a/scripts/store-service/compose.yml +++ b/scripts/store-service/compose.yml @@ -25,5 +25,6 @@ services: read_only: true bind: create_host_path: false - - ./web:/srv/webapp + - ./badges:/srv/badges-export + - ./names:/srv/names-export stop_grace_period: 10s diff --git a/scripts/store-service/store_service.ini.example b/scripts/store-service/store_service.ini.example index e585ecd477..0d5e677a9c 100644 --- a/scripts/store-service/store_service.ini.example +++ b/scripts/store-service/store_service.ini.example @@ -1,14 +1,20 @@ [listener] host = 0.0.0.0 -port = 8080 -; the built webapp in the image, read as the export source -static_dir = /srv/web -; split deployment: Caddy serves the exported folder; this service is the API and webhooks only. -; Set to on for an all-in-one deployment where this service serves the webapp itself. +; the API and the webhooks, and the badges site when serve_webapp = on +badges_port = 8080 +; the badges build is read from the image's /srv/badges, the default of badges_static_dir; the +; image does not build the names site yet, so mount a names build at /srv/names, the default of +; names_static_dir +; split deployment: Caddy serves the exported folders; this service is the API and webhooks only. +; Set to on for an all-in-one deployment where this service serves the sites itself, the names +; site on names_port (default 8081), which also answers the API and the webhooks. serve_webapp = off -; the webapp is written here at boot with the publishable key injected; compose bind-mounts it to a -; host path Caddy serves. Unset it when serve_webapp = on. -webapp_export_dir = /srv/webapp +; the badges site is written here at boot with the publishable key injected; compose bind-mounts it +; to a host path Caddy serves. Unset it when serve_webapp = on. +badges_export_dir = /srv/badges-export +; the names site (simplex.domains), with [names] only: the folder it is exported to, which compose +; bind-mounts to ./names for Caddy +;names_export_dir = /srv/names-export ; on because Caddy proxies /api and /webhooks to this service; without it the rate limiter keys on ; Caddy's address and shares one bucket across all callers trust_forwarded_for = on