Files
geg-gas-web/docker/Dockerfile-node

31 lines
701 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM --platform=linux/arm64 docker.xuanyuan.run/library/node:20.15.1-slim
# 设置工作目录
WORKDIR /app
# 安装依赖http-server和http-proxy-middleware
RUN npm install http-server http-proxy-middleware --production
# 复制自定义服务器脚本server.js
COPY ./server.js /app/
# 复制静态文件到工作目录根据实际项目调整如dist目录
# 假设静态文件在当前目录的dist文件夹下
RUN mkdir -p /app/html
COPY index.html /app/html/index.html
# 暴露端口与server.js中配置的port一致
EXPOSE 8080
# 启动命令通过node运行server.js
CMD ["node", "server.js"]
# docker build -f Dockerfile-node -t node-http-server:1.0.3 .