mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
37 lines
810 B
Docker
37 lines
810 B
Docker
# syntax=docker/dockerfile:1
|
|
FROM --platform=$BUILDPLATFORM node:25-alpine AS builder
|
|
|
|
WORKDIR /build
|
|
|
|
RUN npm install -g pnpm@10
|
|
|
|
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
|
|
|
|
COPY packages ./packages
|
|
COPY apps ./apps
|
|
|
|
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
|
|
pnpm install
|
|
|
|
ARG VITE_API_URL=/api
|
|
ARG VITE_AGENT_URL=/agent
|
|
|
|
ENV VITE_API_URL=$VITE_API_URL
|
|
ENV VITE_AGENT_URL=$VITE_AGENT_URL
|
|
|
|
WORKDIR /build/apps/web
|
|
RUN pnpm build
|
|
|
|
FROM nginx:alpine
|
|
|
|
COPY --from=builder /build/apps/web/dist /usr/share/nginx/html
|
|
|
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 8082
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:8082/health || exit 1
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|