File size: 1,010 Bytes
e5c36fd cf1cbb1 e5c36fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
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"] |