FROM nginx:stable-alpine AS runtime

# 配置 nginx
RUN echo "types { application/javascript js mjs; }" > /etc/nginx/conf.d/mjs.conf \
    && rm -rf /etc/nginx/conf.d/default.conf

# 复制宿主机构建产物
COPY publish/web-antd-dist /usr/share/nginx/html

# 复制 nginx 配置
COPY scripts/deploy/nginx.conf /etc/nginx/nginx.conf

EXPOSE 8080

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