video / Dockerfile
Ethscriptions's picture
步骤3:渲染引擎 + 9 个场景 + WebGL 后期 + 播放器(横屏/竖屏)
f6f03fe verified
Raw History Blame Contribute Delete
859 Bytes
# ---- build -------------------------------------------------------------
FROM node:20-alpine AS build
WORKDIR /app
COPY package.json ./
RUN npm install --no-audit --no-fund
COPY . .
# the song lives in 素材/; copy it into the site (download it if LFS was not materialised)
RUN mkdir -p public && \
if [ -f "素材/黑街.mp3" ] && [ "$(stat -c%s "素材/黑街.mp3")" -gt 100000 ]; then \
cp "素材/黑街.mp3" public/heijie.mp3; \
else \
wget -q -O public/heijie.mp3 "https://huggingface.co/spaces/Ethscriptions/video/resolve/main/%E7%B4%A0%E6%9D%90/%E9%BB%91%E8%A1%97.mp3"; \
fi && \
npm run build
# ---- run ---------------------------------------------------------------
FROM node:20-alpine
WORKDIR /app
COPY --from=build /app/dist ./dist
COPY server.mjs ./
ENV PORT=3000
EXPOSE 3000
USER node
CMD ["node", "server.mjs"]