forked from hangshuo652/aurak
feat: implement QuestionBank CRUD with pagination and template query
- Add pagination support to findAll (page, limit query params) - Add findByTemplateId method to service - Add GET /by-template/:templateId endpoint to controller - Service already includes CRUD for QuestionBank and QuestionBankItem
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
FROM node:22-alpine as builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 设置阿里云源
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||
|
||||
# 设置 yarn 阿里云源并安装依赖
|
||||
COPY web/package*.json web/yarn.lock* ./
|
||||
RUN yarn config set registry https://registry.npmmirror.com && \
|
||||
yarn install
|
||||
|
||||
# 复制源代码
|
||||
COPY web/ .
|
||||
|
||||
# 设置构建时环境变量
|
||||
ARG VITE_API_BASE_URL=/api
|
||||
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
||||
|
||||
# 构建应用
|
||||
RUN yarn build
|
||||
|
||||
# 使用nginx提供静态文件
|
||||
FROM nginx:alpine
|
||||
|
||||
# 删除默认配置
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
|
||||
# 复制自定义 Nginx 配置
|
||||
COPY nginx/conf.d/kb.conf /etc/nginx/conf.d/kb.conf
|
||||
|
||||
# 复制构建产物到nginx目录
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user