@@ -9,15 +9,16 @@ RUN if [ "$USE_MIRROR" = "true" ]; then \
99 sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources; \
1010 fi && \
1111 apt-get update && apt-get install -y --no-install-recommends \
12- curl wget \
12+ curl wget bash \
1313 fonts-wqy-microhei \
1414 libpixman-1-0 libcairo2 libpango1.0-0 libgif7 libjpeg62-turbo libpng16-16 librsvg2-2 libvips42 ffmpeg \
1515 && rm -rf /var/lib/apt/lists/*
1616
17- # 指定 pnpm 版本防止变动
1817RUN corepack enable && corepack prepare pnpm@latest --activate && npm install -g npm@latest
1918WORKDIR /app
2019
20+ FROM edasriyan/lottie-to-gif:latest AS lottie
21+
2122FROM base AS build
2223ARG USE_MIRROR=true
2324
@@ -50,12 +51,19 @@ RUN pnpm --filter=@napgram/core run build
5051COPY web/ /app/web/
5152RUN pnpm --filter=web run build
5253
54+ # Dev/Build 阶段也带上 tgs 转换工具,便于 compose.dev 使用 target=build
55+ COPY --from=lottie /usr/bin/lottie_to_gif.sh /usr/local/bin/tgs_to_gif
56+ COPY --from=lottie /usr/bin/lottie_common.sh /usr/local/bin/lottie_common.sh
57+ COPY --from=lottie /usr/bin/lottie_to_png /usr/local/bin/lottie_to_png
58+ COPY --from=lottie /usr/bin/gifski /usr/local/bin/gifski
59+ ENV TGS_TO_GIF=/usr/local/bin/tgs_to_gif
60+
5361FROM base AS release
5462# Lottie Converter
55- COPY --from=edasriyan/ lottie-to-gif:latest /usr/bin/lottie_to_gif.sh /usr/local/bin/tgs_to_gif
56- COPY --from=edasriyan/ lottie-to-gif:latest /usr/bin/lottie_common.sh /usr/local/bin/lottie_common.sh
57- COPY --from=edasriyan/ lottie-to-gif:latest /usr/bin/lottie_to_png /usr/local/bin/lottie_to_png
58- COPY --from=edasriyan/ lottie-to-gif:latest /usr/bin/gifski /usr/local/bin/gifski
63+ COPY --from=lottie /usr/bin/lottie_to_gif.sh /usr/local/bin/tgs_to_gif
64+ COPY --from=lottie /usr/bin/lottie_common.sh /usr/local/bin/lottie_common.sh
65+ COPY --from=lottie /usr/bin/lottie_to_png /usr/local/bin/lottie_to_png
66+ COPY --from=lottie /usr/bin/gifski /usr/local/bin/gifski
5967ENV TGS_TO_GIF=/usr/local/bin/tgs_to_gif
6068
6169COPY --from=build --chown=node:node /app/node_modules /app/node_modules
0 commit comments