Skip to content

23101 / hlx-demo-11ty

dockerfile
# 构建
FROM node:22-alpine AS builder

WORKDIR /app

COPY . .

RUN npm install --registry https://registry.npmmirror.com  && \
    npm run build


# 生产
FROM nginx:1.24-alpine


COPY --from=builder /app/dist/ /opt
COPY nginx.conf /etc/nginx/conf.d/default.conf


# CMD ["nginx", "-g", "daemon off;"]

EXPOSE 23101
nginx
server {
  listen 23101;

  root /opt;
  index index.html;

  location / {
    try_files $uri $uri/ /index.html;
  }
}