feat(demo): add read-only demo dockerfile and nginx api mocking.
This commit is contained in:
30
Dockerfile.demo
Normal file
30
Dockerfile.demo
Normal 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;"]
|
||||
Reference in New Issue
Block a user