24 lines
619 B
Docker
24 lines
619 B
Docker
FROM node:20-alpine AS builder
|
|
|
|
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories \
|
|
&& npm config set registry https://package-mirror.liara.ir/repository/npm
|
|
|
|
WORKDIR /build
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM nginx:stable-alpine AS production
|
|
|
|
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories
|
|
|
|
COPY --from=builder /build/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|