2026-10-10 17:20:00 +08:00
|
|
|
FROM node:20-bookworm-slim
|
|
|
|
|
|
2026-10-10 18:47:30 +08:00
|
|
|
ENV TZ=Asia/Shanghai \
|
|
|
|
|
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com
|
2026-10-10 17:20:00 +08:00
|
|
|
RUN echo $TZ > /etc/timezone && \
|
|
|
|
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
|
|
|
|
|
dpkg-reconfigure -f noninteractive tzdata
|
|
|
|
|
|
2026-10-10 18:47:30 +08:00
|
|
|
# ffmpeg 用于向 Nginx-RTMP 循环推流
|
2026-10-10 17:20:00 +08:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && \
|
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
WORKDIR /simulator
|
|
|
|
|
|
|
|
|
|
COPY simulator/package.json ./
|
2026-10-10 18:47:30 +08:00
|
|
|
RUN npm config set registry https://registry.npmmirror.com && \
|
|
|
|
|
npm install --omit=dev
|
2026-10-10 17:20:00 +08:00
|
|
|
|
|
|
|
|
COPY simulator/simulator.js ./
|
|
|
|
|
COPY simulator/assets /assets
|
|
|
|
|
|
|
|
|
|
ENV ASSETS_DIR=/assets \
|
|
|
|
|
FFMPEG_BIN=ffmpeg
|
|
|
|
|
|
|
|
|
|
CMD ["node", "simulator.js"]
|