sq66 commited on
Commit
e9cade1
·
verified ·
1 Parent(s): d316f88

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -10
Dockerfile CHANGED
@@ -1,15 +1,14 @@
1
- # 使用官方的轻量级 Nginx 镜像
2
- FROM nginx:alpine
3
 
4
- # 删除 Nginx 默认的配置文件,以免冲突
5
  RUN rm /etc/nginx/conf.d/default.conf
6
 
7
- # 将我们编写的 nginx.conf 文件复制到容器中 Nginx 的配置目录
8
- COPY nginx.conf /etc/nginx/nginx.conf
9
 
10
- # 声明容器将监听 7860 端口 (虽然 Nginx 配置里已经写了,但这有助于 Docker 管理)
11
- EXPOSE 7860
12
 
13
- # 设置容器启动时运行 Nginx 服务
14
- # -g 'daemon off;' 参数让 Nginx 在前台运行,这是 Docker 容器的标准做法
15
- CMD ["nginx", "-g", "daemon off;"]
 
1
+ # 使用官方的 Nginx 镜像作为基础
2
+ FROM nginx:stable-alpine
3
 
4
+ # 删除 Nginx 默认的配置文件
5
  RUN rm /etc/nginx/conf.d/default.conf
6
 
7
+ # 将我们自己写的 Nginx 配置文件复制到容器里
8
+ COPY nginx.conf /etc/nginx/conf.d/
9
 
10
+ # 暴露 8080 端口 (Hugging Face Space 通常会访问这个端口)
11
+ EXPOSE 8080
12
 
13
+ # 容器启动时运行 Nginx
14
+ CMD ["nginx", "-g", "daemon off;"]