video-shuoshan/web/Dockerfile
zyc a7a9fdf4fe
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 25s
fix: use DaoCloud mirror for base images to avoid Docker Hub timeout
2026-04-04 13:14:20 +08:00

23 lines
505 B
Docker

# ---- Build Stage ----
FROM docker.m.daocloud.io/node:18-alpine AS builder
RUN npm config set registry https://registry.npmmirror.com
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# ---- Runtime Stage ----
FROM docker.m.daocloud.io/nginx:alpine
RUN sed -i 's#dl-cdn.alpinelinux.org#mirrors.aliyun.com#g' /etc/apk/repositories
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]