FROM node:lts AS BUILD_IMAGE # Update the package list and install git RUN apt-get update && apt-get install -y git WORKDIR /app # Pull GitHub repository RUN git clone https://github.com/Niansuh/deepseek-free-api.git /app # Install dependencies and build the project RUN yarn install --registry https://registry.npmmirror.com/ && yarn run build FROM node:lts-alpine # Copy build output, package.json and public directory from build stage COPY --from=BUILD_IMAGE /app/dist /app/dist COPY --from=BUILD_IMAGE /app/package.json /app/package.json COPY --from=BUILD_IMAGE /app/public /app/public WORKDIR /app # Install production dependencies RUN yarn install --production --registry https://registry.npmmirror.com/ # Create the log directory and grant write permissions RUN mkdir -p /app/logs && chmod 777 /app/logs # Specify port environment variable ENV PORT 7860 # Expose port EXPOSE $PORT # Specify the command to be executed when the container starts CMD ["node", "dist/index.js", "--port", "7860"]