- 新增 Article 数据模型 + 迁移(title/subtitle/body/coverImage/caption) - 后端:公共 /api/articles 查询接口 + 管理端 CRUD/上传/二维码 - 前端:移动端 /article/:id 阅读页(Playfair + 纸张肌理 + 首行缩进) - Admin:新增文章管理三页(列表/表单/二维码)与侧栏入口 - 导入 6 篇点位解说词:朝天宫/七家湾/运渎/打钉巷/绒庄街/熙南里 - Admin 二维码页增加「复制链接(写入 NFC)」按钮 - 落地页步骤文案从扫码改为 NFC 触碰 - Dockerfile + entrypoint 增加 articles 图片回灌 - 修复 deploy-stamp skill 构建轮询卡住(pgrep 模式错误) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
48 lines
1.7 KiB
Docker
48 lines
1.7 KiB
Docker
FROM node:22-alpine
|
||
|
||
WORKDIR /app
|
||
|
||
# 国内构建环境加速(仅容器构建期生效,不影响本地/正式 registry)
|
||
# 1) Alpine apk 源换清华
|
||
RUN sed -i 's|https\?://dl-cdn.alpinelinux.org|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/apk/repositories
|
||
|
||
RUN corepack enable && corepack prepare pnpm@9 --activate \
|
||
&& apk add --no-cache openssl
|
||
|
||
# 2) npm / pnpm registry 换淘宝镜像
|
||
# 3) Prisma 下载引擎走淘宝镜像
|
||
ENV PRISMA_ENGINES_MIRROR=https://registry.npmmirror.com/-/binary/prisma
|
||
RUN npm config set registry https://registry.npmmirror.com/ \
|
||
&& pnpm config set registry https://registry.npmmirror.com/
|
||
|
||
# Copy everything (.dockerignore filters out node_modules, dist, .git, etc.)
|
||
COPY . .
|
||
|
||
# 强制项目级 registry(兜底:防止项目根 .npmrc 未覆盖)
|
||
RUN echo "registry=https://registry.npmmirror.com/" > /app/.npmrc
|
||
|
||
# Install all deps (tsx is used at runtime via devDependencies)
|
||
RUN pnpm install --frozen-lockfile --registry=https://registry.npmmirror.com/
|
||
|
||
# Generate Prisma client (produces linux-musl binary per schema.prisma)
|
||
RUN pnpm exec prisma generate
|
||
|
||
# Build web SPA; server runs directly from TS via tsx
|
||
RUN pnpm --filter @stamp/web build
|
||
|
||
# Stash initial stamp + article assets so the uploads volume can be seeded on first run
|
||
RUN mkdir -p /app/stamps-seed \
|
||
&& cp packages/server/uploads/stamps/*.jpg /app/stamps-seed/ \
|
||
&& rm -rf packages/server/uploads/stamps
|
||
RUN mkdir -p /app/articles-seed \
|
||
&& cp packages/server/uploads/articles/*.jpg /app/articles-seed/ \
|
||
&& rm -rf packages/server/uploads/articles
|
||
|
||
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||
|
||
ENV NODE_ENV=production
|
||
EXPOSE 3000
|
||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|