jimeng-free-api/Dockerfile
2025-05-30 19:27:01 +08:00

26 lines
746 B
Docker

FROM node:20.19-slim
WORKDIR /app
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this first prevents re-running npm install on every code change.
COPY package*.json ./
# Install dependencies
RUN yarn install --registry https://registry.npmmirror.com/ --ignore-engines
# Copy the rest of the application files to the container image.
COPY . .
# Build the application
RUN yarn run build
RUN echo "Debug: Contents of /app after build:"
RUN ls -la /app
RUN echo "Debug: Contents of /app/dist after build:"
RUN ls -la /app/dist || echo "Debug: /app/dist directory not found or ls failed"
EXPOSE 3302
CMD ["sh", "-c", "npm run start"]