boxes-fe/Dockerfile.build

23 lines
462 B
Docker
Raw Permalink Normal View History

# Stage 1: Install dependencies
FROM node:14 AS build-stage
WORKDIR /app
# Copy package.json and package-lock.json first to leverage caching
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of your application code
COPY .env .
COPY . .
# Build the application
RUN npm run build
2024-10-30 00:41:34 +00:00
# Final stage: Use a minimal base image
FROM alpine:latest
2024-10-30 00:41:34 +00:00
# Copy the build output from the previous stage
COPY --from=build-stage /app/build ./build