Dockerfile 639 B

123456789101112131415161718192021
  1. FROM node:18-alpine AS builder
  2. RUN apk add --no-cache git git-lfs
  3. WORKDIR /app
  4. RUN npm install -g pnpm@9.3.0
  5. COPY package.json pnpm-lock.yaml ./
  6. RUN pnpm install --frozen-lockfile
  7. COPY . .
  8. RUN git lfs pull
  9. ARG APP_TITLE=成都网讯MaaS底座
  10. ARG ENABLE_PLAYGROUND=true
  11. ENV APP_TITLE=$APP_TITLE
  12. ENV ENABLE_PLAYGROUND=$ENABLE_PLAYGROUND
  13. RUN pnpm build
  14. FROM nginx:alpine
  15. RUN apk add --no-cache gettext
  16. COPY --from=builder /app/dist /usr/share/nginx/html
  17. COPY nginx.conf.template /etc/nginx/conf.d/default.conf.template
  18. COPY docker-entrypoint.sh /docker-entrypoint.d/99-envsubst.sh
  19. RUN chmod +x /docker-entrypoint.d/99-envsubst.sh
  20. EXPOSE 80