Spaces:
Running
Running
File size: 693 Bytes
8e4361b af90202 d403110 2371bb9 8e4361b d403110 2371bb9 d403110 8e4361b d403110 8e4361b d403110 8e4361b d403110 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# 使用基于Alpine的官方Nginx镜像
FROM nginx:alpine
# 创建缓存目录并赋予适当的权限
RUN mkdir -p /var/cache/nginx/client_temp && \
mkdir -p /var/cache/nginx/proxy_temp && \
mkdir -p /var/cache/nginx/fastcgi_temp && \
mkdir -p /var/cache/nginx/scgi_temp && \
mkdir -p /var/cache/nginx/uwsgi_temp && \
chown -R nginx:nginx /var/cache/nginx
#配置
COPY nginx.conf /etc/nginx/nginx.conf
COPY . /usr/share/nginx/html
# 设置工作目录的权限
RUN chown -R nginx:nginx /usr/share/nginx/html
# 设置用户为nginx,以确保以正确的权限运行
USER nginx
# 暴露必要的端口
EXPOSE 7860
# 启动Nginx
CMD ["nginx", "-g", "daemon off;"]
|