FROM node:18-alpine AS builder
WORKDIR /app
RUN npm install -g pnpm@9.3.0
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
ARG APP_TITLE=成都网讯MaaS底座
ARG ENABLE_PLAYGROUND=true
ENV APP_TITLE=$APP_TITLE
ENV ENABLE_PLAYGROUND=$ENABLE_PLAYGROUND
RUN pnpm build

FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
