feat: 小程序连接服务器IP + 同步未提交开发
- miniprogram/config.js: BASE_URL 指向 http://192.227.237.8:3001 - 动作标题中文化(nameZh),搜索匹配 name/nameZh/nameEn - 新增计划/收藏/我的 等页面与组件 - 后端 Docker 化(Dockerfile/.dockerignore)与翻译脚本 - .gitignore 补充 .DS_Store
This commit is contained in:
27
backend/Dockerfile
Normal file
27
backend/Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
# ---- build stage ----
|
||||
FROM node:20-slim AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
# npm run build => ensure-data (skip, dataset present) + nest build + copy-data
|
||||
RUN npm run build
|
||||
|
||||
# ---- runtime stage ----
|
||||
FROM node:20-slim AS runtime
|
||||
ENV NODE_ENV=production \
|
||||
PORT=3000 \
|
||||
CORS_ENABLED=true \
|
||||
MEDIA_BASE_URL=https://cdn.jsdelivr.net/gh/hasaneyldrm/exercises-dataset@main \
|
||||
JWT_SECRET=fitcoach-dev-secret
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev && npm cache clean --force
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
EXPOSE 3000
|
||||
# data-store 是运行时生成的 JSON 库,挂卷持久化
|
||||
VOLUME ["/app/data-store"]
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
||||
CMD node -e "fetch('http://localhost:'+process.env.PORT+'/api/exercises').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
|
||||
CMD ["node", "dist/main.js"]
|
||||
Reference in New Issue
Block a user