Files
crawlab/frontend/Dockerfile
Marvin Zhang ca5113fd33 chore: update Dockerfile and add .dockerignore
- Modified the Dockerfile to change the way application code is added, improving clarity and structure.
- Updated the COPY command to reference the correct path for built artifacts.
- Added a new .dockerignore file to exclude node_modules from the Docker build context, optimizing the build process.
- Removed the unnecessary .Dockerfile.swp file.
2025-04-16 10:40:31 +08:00

28 lines
554 B
Docker

# Build stage
FROM node:20-alpine AS build
# Arguments and environment variables for building packages
ARG VITE_APP_API_BASE_URL=/api
ENV VITE_APP_API_BASE_URL ${VITE_APP_API_BASE_URL}
# Set the working directory in the container
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Copy application code
ADD ./crawlab-ui /app
# Install project dependencies
RUN pnpm install
# Build the application
RUN pnpm run build
# Production stage
FROM alpine:3.14
# Copy only the built artifacts from the build stage
COPY --from=build /app/dist /app/dist