nginx 服务器未启动它抛出错误 bind() to 0.0.0.0:80 failed (13: Permission denied)

nginx server not starting it throw an error bind() to 0.0.0.0:80 failed (13: Permission denied)

我正在将 php symfony 基本欢迎页面项目配置到 docker 我正在使用图像

richarvey nginx-php-fpm

这有我需要 运行 php 框架和 docker 的所有包(nginx,php,alpine,docker 标签) 我的 nginx 服务器不工作,当在我的终端(Ubuntu 20.04.2 LTS)中写入 nginx 时,我收到以下错误

nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

DIR

project
├── app       
├── .git               
├── docker-compose.yml
├── Dockerfile
└── README.md

docker-compose.yml

version: '3.8'

services:   test-app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: test-app-container
    volumes:
      - ./app/:/var/www/html
    ports:
      - "8080:80"

Docker 文件

FROM richarvey/nginx-php-fpm:latest

ENV WEBROOT="/var/www/html/public"

COPY app/* /var/www/html/

WORKDIR /var/www/html

我已经修复了图像版本问题和用户权限问题,为此我为项目构建添加了所有者和组的环境变量,以便为所需图像创建容器

version: '3.8'

services:
  test-app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: test-app-container
    volumes:
      - ./app/:/var/www/html/
    environment:
      PGID: 1000
      PUID: 1000
    ports:
      - "8080:80"