22 lines
855 B
Docker
22 lines
855 B
Docker
FROM node:24.18.1-slim AS frontend-build
|
|
WORKDIR /app
|
|
RUN corepack enable && corepack prepare pnpm@10.15.1 --activate
|
|
COPY frontend/package.json frontend/pnpm-lock.yaml ./
|
|
RUN pnpm install --frozen-lockfile
|
|
COPY frontend/ ./
|
|
RUN pnpm typecheck && pnpm build
|
|
|
|
FROM nginx:alpine
|
|
ENV TZ=Asia/Shanghai
|
|
RUN apk add --no-cache tzdata \
|
|
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
|
|
&& echo $TZ > /etc/timezone
|
|
COPY ./default.conf /etc/nginx/conf.d/default.conf.template
|
|
COPY ./scripts/nginx-entrypoint.sh /usr/local/bin/model-platform-entrypoint.sh
|
|
RUN sed -i 's/\r$//' /usr/local/bin/model-platform-entrypoint.sh \
|
|
&& chmod +x /usr/local/bin/model-platform-entrypoint.sh
|
|
COPY --from=frontend-build /app/build/client /usr/share/nginx/html
|
|
EXPOSE 80
|
|
ENTRYPOINT ["/usr/local/bin/model-platform-entrypoint.sh"]
|
|
CMD ["nginx", "-g", "daemon off;"]
|