catpawplay / Dockerfile
wangdang's picture
Update Dockerfile
faef360 verified
Raw
History Blame Contribute Delete
711 Bytes
FROM node:18-alpine
WORKDIR /app
RUN apk add --no-cache unzip
# 复制并解压您的 dist.zip(自动处理可能的顶层子目录)
COPY dist.zip /tmp/dist.zip
RUN unzip -o /tmp/dist.zip -d /tmp/extract && \
cd /tmp/extract && \
if [ $(ls -1 | wc -l) -eq 1 ] && [ -d "$(ls -1)" ]; then \
mv $(ls -1)/* /app/ ; \
else \
mv * /app/ ; \
fi && \
rm -rf /tmp/extract /tmp/dist.zip
# 安装 http-proxy(用于转发)
RUN npm install http-proxy
# 复制代理脚本
COPY proxy.js /app/proxy.js
# 限制 Node 堆内存,防止启动 OOM
ENV NODE_OPTIONS="--max-old-space-size=384"
EXPOSE 7860
# 运行代理(它会启动 runner.cjs)
CMD ["node", "/app/proxy.js"]