- Add the event results page with schedule, rankings, Battle bracket, athletes, records, bilingual labels, and navigation entry. - Add the read/write competition data service, a complete Excel example, empty public state, and validation smoke tests. - Handle Furion statusCode/data responses from the production API and retain static fallback for the public page. - Document Docker sidecar deployment beside test_eventapi, persistent storage, private admin access, Nginx routing, and OSS asset rewriting. Verification: - node server/competition-api.smoke.mjs - node scripts/competition-response-test.mjs - node scripts/battle-layout-test.mjs - npm run build -- --base=https://assets.example.test/static/test/ - npm run rewrite:oss -- https://assets.example.test/static/test/ - Production /api/competition/state returned HTTP 200 after the sidecar started. Deployment note: publish the updated YD-WEB static build before public results can consume the unwrapped API response. The event remains unpublished until an administrator saves and publishes data.
18 lines
629 B
Docker
18 lines
629 B
Docker
FROM node:22-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
COPY server/competition-api.mjs /app/server/competition-api.mjs
|
|
COPY public/competition-state.json /app/public/competition-state.json
|
|
|
|
RUN mkdir -p /app/data && touch /app/data/.keep && chown -R node:node /app
|
|
USER node
|
|
|
|
ENV NODE_ENV=production \
|
|
COMPETITION_DATA_PATH=/app/data/competition-state.json
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD node -e "require('node:http').get('http://127.0.0.1:8787/api/competition/ping', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"
|
|
|
|
CMD ["node", "server/competition-api.mjs"]
|