32 lines
577 B
Docker
32 lines
577 B
Docker
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install --frozen-lockfile
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM nginx:alpine
|
|
|
|
RUN rm -rf /usr/share/nginx/html/*
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
|
RUN echo 'server { \
|
|
listen 80; \
|
|
server_name _; \
|
|
root /usr/share/nginx/html; \
|
|
index index.html; \
|
|
location / { \
|
|
try_files $uri /index.html; \
|
|
} \
|
|
error_page 404 /index.html; \
|
|
}' > /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|
|
= |