Ошибка при запуске docker-compose файла

Я написал проект на Django и хотел сделать docker compose файл для деплоя но при запуске вылетает ошибка bind(): Permission denied [core/socket.c line 230]. Вот весь лог

edu-proj-db-1     | 
edu-proj-db-1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
edu-proj-db-1     | 
edu-proj-db-1     | 2023-06-09 15:53:39.103 UTC [1] LOG:  starting PostgreSQL 14.5 (Debian 14.5-2.pgdg110+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
edu-proj-cache-1  | 1:C 09 Jun 2023 15:53:39.116 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
edu-proj-cache-1  | 1:C 09 Jun 2023 15:53:39.116 # Redis version=7.0.4, bits=64, commit=00000000, modified=0, pid=1, just started
edu-proj-cache-1  | 1:C 09 Jun 2023 15:53:39.116 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.117 * monotonic clock: POSIX clock_gettime
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 * Running mode=standalone, port=6379.
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 # Server initialized
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 * Loading RDB produced by version 7.0.4
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 * RDB age 3 seconds
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 * RDB memory usage when created 0.82 Mb
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 * Done loading RDB, keys loaded: 0, keys expired: 0.
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 * DB loaded from disk: 0.000 seconds
edu-proj-cache-1  | 1:M 09 Jun 2023 15:53:39.118 * Ready to accept connections
edu-proj-db-1     | 2023-06-09 15:53:39.128 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
edu-proj-db-1     | 2023-06-09 15:53:39.128 UTC [1] LOG:  listening on IPv6 address "::", port 5432
edu-proj-db-1     | 2023-06-09 15:53:39.135 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
edu-proj-db-1     | 2023-06-09 15:53:39.161 UTC [25] LOG:  database system was shut down at 2023-06-09 15:53:36 UTC
edu-proj-db-1     | 2023-06-09 15:53:39.167 UTC [1] LOG:  database system is ready to accept connections
edu-proj-nginx-1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
edu-proj-nginx-1  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
edu-proj-nginx-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
edu-proj-nginx-1  | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
edu-proj-nginx-1  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
edu-proj-nginx-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
edu-proj-nginx-1  | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/default.conf.template to /etc/nginx/conf.d/default.conf
edu-proj-nginx-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
edu-proj-nginx-1  | /docker-entrypoint.sh: Configuration complete; ready for start up
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: using the "epoll" event method
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: nginx/1.23.1
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: OS: Linux 5.19.0-43-generic
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: start worker processes
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: start worker process 35
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: start worker process 36
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: start worker process 37
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: start worker process 38
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: start worker process 39
edu-proj-nginx-1  | 2023/06/09 15:53:39 [notice] 1#1: start worker process 40
edu-proj-web-1    | wait-for-it.sh: waiting 15 seconds for db:5432
edu-proj-web-1    | wait-for-it.sh: db:5432 is available after 0 seconds
edu-proj-web-1    | [uWSGI] getting INI configuration from /code/config/uwsgi/uwsgi.ini
edu-proj-web-1    | *** Starting uWSGI 2.0.21 (64bit) on [Fri Jun  9 15:53:39 2023] ***
edu-proj-web-1    | compiled with version: 10.2.1 20210110 on 09 June 2023 12:01:43
edu-proj-web-1    | os: Linux-5.19.0-43-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2
edu-proj-web-1    | nodename: 8b1a0fb60bf4
edu-proj-web-1    | machine: x86_64
edu-proj-web-1    | clock source: unix
edu-proj-web-1    | pcre jit disabled
edu-proj-web-1    | detected number of CPU cores: 6
edu-proj-web-1    | current working directory: /code
edu-proj-web-1    | detected binary path: /usr/local/bin/uwsgi
edu-proj-web-1    | setgid() to 33
edu-proj-web-1    | setuid() to 33
edu-proj-web-1    | chdir() to /code/educa/
edu-proj-web-1    | your memory page size is 4096 bytes
edu-proj-web-1    | detected max file descriptor number: 1048576
edu-proj-web-1    | lock engine: pthread robust mutexes
edu-proj-web-1    | thunder lock: disabled (you can enable it with --thunder-lock)
edu-proj-web-1    | bind(): Permission denied [core/socket.c line 230]
edu-proj-web-1 exited with code 0
edu-proj-web-1    | wait-for-it.sh: waiting 15 seconds for db:5432
edu-proj-web-1    | wait-for-it.sh: db:5432 is available after 0 seconds
edu-proj-web-1    | [uWSGI] getting INI configuration from /code/config/uwsgi/uwsgi.ini
edu-proj-web-1    | *** Starting uWSGI 2.0.21 (64bit) on [Fri Jun  9 15:53:40 2023] ***
edu-proj-web-1    | compiled with version: 10.2.1 20210110 on 09 June 2023 12:01:43
edu-proj-web-1    | os: Linux-5.19.0-43-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2
edu-proj-web-1    | nodename: 8b1a0fb60bf4
edu-proj-web-1    | machine: x86_64
edu-proj-web-1    | clock source: unix
edu-proj-web-1    | pcre jit disabled
edu-proj-web-1    | detected number of CPU cores: 6
edu-proj-web-1    | current working directory: /code
edu-proj-web-1    | detected binary path: /usr/local/bin/uwsgi
edu-proj-web-1    | setgid() to 33
edu-proj-web-1    | setuid() to 33
edu-proj-web-1    | chdir() to /code/educa/
edu-proj-web-1    | your memory page size is 4096 bytes
edu-proj-web-1    | detected max file descriptor number: 1048576
edu-proj-web-1    | lock engine: pthread robust mutexes
edu-proj-web-1    | thunder lock: disabled (you can enable it with --thunder-lock)
edu-proj-web-1    | bind(): Permission denied [core/socket.c line 230]
edu-proj-web-1 exited with code 1
edu-proj-web-1    | wait-for-it.sh: waiting 15 seconds for db:5432
edu-proj-web-1    | wait-for-it.sh: db:5432 is available after 0 seconds
edu-proj-web-1    | [uWSGI] getting INI configuration from /code/config/uwsgi/uwsgi.ini
edu-proj-web-1    | *** Starting uWSGI 2.0.21 (64bit) on [Fri Jun  9 15:53:40 2023] ***
edu-proj-web-1    | compiled with version: 10.2.1 20210110 on 09 June 2023 12:01:43
edu-proj-web-1    | os: Linux-5.19.0-43-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2
edu-proj-web-1    | nodename: 8b1a0fb60bf4
edu-proj-web-1    | machine: x86_64
edu-proj-web-1    | clock source: unix
edu-proj-web-1    | pcre jit disabled
edu-proj-web-1    | detected number of CPU cores: 6
edu-proj-web-1    | current working directory: /code
edu-proj-web-1    | detected binary path: /usr/local/bin/uwsgi
edu-proj-web-1    | setgid() to 33
edu-proj-web-1    | setuid() to 33
edu-proj-web-1    | chdir() to /code/educa/
edu-proj-web-1    | your memory page size is 4096 bytes
edu-proj-web-1    | detected max file descriptor number: 1048576
edu-proj-web-1    | lock engine: pthread robust mutexes
edu-proj-web-1    | thunder lock: disabled (you can enable it with --thunder-lock)
edu-proj-web-1    | bind(): Permission denied [core/socket.c line 230]
edu-proj-web-1 exited with code 1

когда я захожу на сайт по ссылке http://localhost:80/ то сайт не грузится но nginx откликается в терминале.

docker-compose.yml:

services:

  cache:
    image: redis:7.0.4
    restart: always
    volumes:
      - ./data/cache:/data

  db:
    image: postgres:14.5
    restart: always
    volumes:
      - ./data/db:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres

  web:
    build: .
    command: ["./wait-for-it.sh", "db:5432", "--","uwsgi", "--ini", "/code/config/uwsgi/uwsgi.ini"]
    restart: always
    volumes:
      - .:/code
    environment:
      - DJANGO_SETTINGS_MODULE=educa.settings.prod
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
    depends_on:
      - db
      - cache

  nginx:
    image: nginx:1.23.1
    restart: always
    volumes:
      - ./config/nginx:/etc/nginx/templates
      - .:/code
    ports:
      - "80:80"

Dockerfile:

FROM python:3.10.6

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

WORKDIR /code

RUN pip install --upgrade pip
COPY requirements.txt /code/
RUN pip install -r requirements.txt

COPY . /code/
Директоия выглядит так:
Edu-proj/
  config/
     nginx/
       default.conf.template
     uwsgi/
       uwsgi.ini
  educa/
    ...
    settings/
      __init__.py
      base.py
      local.py
      prod.py
    manage.py
  wait-for-it.sh
  requirements.txt

Если надо еще какая то информация - пишите


Ответы (0 шт):