feat(demo): add read-only demo dockerfile and nginx api mocking.

This commit is contained in:
2026-01-01 16:19:18 -06:00
parent 9d2a19a7bd
commit c174d4af49
3 changed files with 227 additions and 0 deletions

30
Dockerfile.demo Normal file
View File

@@ -0,0 +1,30 @@
# Build arguments
ARG NODE_VERSION=20
ARG NODE_ALPINE_SHA256=sha256:6a91081a440be0b57336fbc4ee87f3dab1a2fd6f80cdb355dcf960e13bda3b59
# Build the frontend
FROM node:${NODE_VERSION}-alpine@${NODE_ALPINE_SHA256} AS build-frontend
WORKDIR /src
COPY package.json vite.config.js pnpm-lock.yaml tailwind.config.js postcss.config.js ./
COPY meshchatx ./meshchatx
RUN corepack enable && corepack prepare pnpm@latest --activate
RUN pnpm install
RUN pnpm run build-frontend
RUN find /src/meshchatx/public -type d -exec chmod 755 {} + && \
find /src/meshchatx/public -type f -exec chmod 644 {} +
# Runtime stage
FROM nginxinc/nginx-unprivileged:alpine
COPY --from=build-frontend --chown=101:101 /src/meshchatx/public /usr/share/nginx/html
COPY nginx.demo.conf /etc/nginx/conf.d/default.conf
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]