7
0

快速搭建静态网站

2026-05-03
2026-05-03
快速搭建静态网站

1. 创建目录

mkdir -p /root/data/docker_data/smtool_web

将静态html文件改名为index.html并上传至/root/data/docker_data/smtool_web

2. 创建docker

docker run -d \
  --name smtool \
  -p 16081:80 \
  -v /root/data/docker_data/smtool_web:/usr/share/nginx/html:ro \
  nginx:alpine

自建站点名为smtool(水木合集转寄格式处理工具)

端口16081(自定义)

:ro表示只读,降低安全风险

Nginx Alpine refers to a lightweight distribution of the Nginx web server built on the Alpine Linux operating system. It is a popular choice for developers who need high-performance web serving with a minimal security footprint and small disk space requirements.

3. 绑定NPM

创建新的ssl证书