25 lines
497 B
Docker
25 lines
497 B
Docker
# Build Stage
|
|
FROM node:20-alpine AS build
|
|
|
|
# Install dependencies for native modules if needed
|
|
RUN apk add --no-cache python3 make g++
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json ./
|
|
|
|
# Install dependencies without lockfile to avoid conflicts
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
|
|
# Build the app
|
|
RUN npm run build
|
|
|
|
# Production Stage
|
|
FROM nginx:alpine
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|