mancala/apps/frontend/Dockerfile
Halit Aksoy f5dcf930fa feat(frontend): log in with Keycloak, as a guest or with an account
- First visit logs in as a new guest through Keycloak without a form;
  the session, including an offline refresh token, is kept in local storage
- Account menu on the home page: guests can log in or sign up, users can
  log out (which starts a new guest session)
- The WebSocket client in core authenticates with the access token after
  connecting, reports "connected" once the server accepts it, and re-sends
  renewed tokens on the open connection
- Game page shows player names; guests appear as "Guest 4F2A"
- Auth channels, AuthUser and player names in UserConnectionInfo move to
  core and the backend uses them from there
- Mobile keeps using userKey login for now
2026-10-14 02:22:13 +03:00

34 lines
639 B
Docker

# Build from the repo root: docker build -f apps/frontend/Dockerfile .
FROM node:20-alpine3.19 AS build
ARG SERVER_ADDRESS WS_SERVER_ADDRESS KEYCLOAK_URL
WORKDIR /app
# Local packages the frontend links to
COPY package.json ./
COPY packages packages
RUN yarn build:packages
WORKDIR /app/apps/frontend
COPY apps/frontend/package.json ./
COPY apps/frontend/yarn.lock ./
RUN yarn install
COPY apps/frontend ./
RUN yarn build
FROM nginx:stable-alpine
COPY --from=build /app/apps/frontend/dist /usr/share/nginx/html
COPY apps/frontend/nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]