wrongmove/crawler/frontend/Dockerfile
2025-06-16 22:43:46 +00:00

29 lines
631 B
Docker

# Stage 1: Build the React app
FROM node:24-alpine AS builder
WORKDIR /app
# Copy package files first for better caching
COPY package.json package-lock.json* ./
# Install dependencies (prefers yarn if available)
RUN npm ci
# Copy all files and build
COPY . .
RUN npm run build # TODO: MOVE ME BELOW
FROM nginx:alpine
# Remove default nginx static files
RUN rm -rf /usr/share/nginx/html/*
WORKDIR /app
# Copy only necessary files from the builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]