|
|
|
FROM node:lts AS BUILD_IMAGE |
|
|
|
|
|
RUN apt-get update && apt-get install -y git |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN git clone https://github.com/Sunhaha520/qwen-free-api.git /app |
|
|
|
|
|
RUN yarn install --registry https://registry.npmmirror.com/ && yarn run build |
|
|
|
|
|
FROM node:lts-alpine |
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY --from=BUILD_IMAGE /app/configs /app/configs |
|
COPY --from=BUILD_IMAGE /app/package.json /app/package.json |
|
COPY --from=BUILD_IMAGE /app/dist /app/dist |
|
COPY --from=BUILD_IMAGE /app/public /app/public |
|
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules |
|
|
|
|
|
RUN yarn install --production --registry https://registry.npmmirror.com/ |
|
|
|
|
|
RUN mkdir -p /app/logs && chmod 777 /app/logs |
|
|
|
|
|
ENV PORT 7860 |
|
|
|
|
|
EXPOSE $PORT |
|
|
|
|
|
CMD ["node", "dist/index.js", "--port", "7860"] |