rogerxavier commited on
Commit
8e4361b
·
verified ·
1 Parent(s): d403110

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -7
Dockerfile CHANGED
@@ -1,18 +1,25 @@
1
- # Use the official Nginx image based on Alpine
2
  FROM nginx:alpine
3
 
4
- # Create a directory with the right permissions
5
- RUN mkdir -p /var/cache/nginx && \
 
 
 
 
6
  chown -R nginx:nginx /var/cache/nginx
7
 
8
- # Copy your web files into the Nginx HTML directory
9
  COPY . /usr/share/nginx/html
10
 
11
- # Set the user to nginx to ensure it runs with the correct permissions
 
 
 
12
  USER nginx
13
 
14
- # Expose the necessary port
15
  EXPOSE 7860
16
 
17
- # Start Nginx
18
  CMD ["nginx", "-g", "daemon off;"]
 
1
+ # 使用基于Alpine的官方Nginx镜像
2
  FROM nginx:alpine
3
 
4
+ # 创建缓存目录并赋予适当的权限
5
+ RUN mkdir -p /var/cache/nginx/client_temp && \
6
+ mkdir -p /var/cache/nginx/proxy_temp && \
7
+ mkdir -p /var/cache/nginx/fastcgi_temp && \
8
+ mkdir -p /var/cache/nginx/scgi_temp && \
9
+ mkdir -p /var/cache/nginx/uwsgi_temp && \
10
  chown -R nginx:nginx /var/cache/nginx
11
 
12
+ # 复制你的网页文件到NginxHTML目录
13
  COPY . /usr/share/nginx/html
14
 
15
+ # 设置工作目录的权限
16
+ RUN chown -R nginx:nginx /usr/share/nginx/html
17
+
18
+ # 设置用户为nginx,以确保以正确的权限运行
19
  USER nginx
20
 
21
+ # 暴露必要的端口
22
  EXPOSE 7860
23
 
24
+ # 启动Nginx
25
  CMD ["nginx", "-g", "daemon off;"]