Files
citywalk-stamp/Dockerfile
YANG JIANKUAN ae63cb1d85 feat: 新增音乐播放模块
- 新增 Music 数据模型 + 迁移(title/subtitle/audioFile)
- 后端:公共 /api/music 查询接口 + 管理端 CRUD
  (音频上传专用 multer,限制 20MB)
- 移动端 /music/:id 播放页:
  - 金色印章式唱片 + 旋转虚线环 + 三重金色涟漪
  - preload=auto + HTTP Range 流式加载
  - 浏览器禁止 autoplay 时显示「轻点聆听」overlay
  - 自定义进度条与时间显示
- Admin:新增音乐管理三页(列表/表单/二维码)与侧栏入口
- 导入示例音乐:朝天宫之歌
- Dockerfile + entrypoint 增加 music 资产回灌

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-19 18:37:44 +08:00

51 lines
1.9 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
RUN mkdir -p /app/music-seed \
&& cp packages/server/uploads/music/* /app/music-seed/ 2>/dev/null || true \
&& rm -rf packages/server/uploads/music
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"]