It's impossible to restart the container
When stopping the container and starting it again the daemon will fail. docker logs
produces the following errors:
[uWSGI] getting INI configuration from /etc/uwsgi/apps-enabled/mat2-web.ini
*** Starting uWSGI 2.0.18-debian (64bit) on [Fri Nov 26 12:02:53 2021] ***
compiled with version: 8.2.0 on 10 February 2019 02:42:46
os: Linux-5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30)
nodename: docker1
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /var/www/mat2-web
detected binary path: /usr/bin/uwsgi-core
chdir() to /var/www/mat2-web/
your processes number limit is 31701
your memory page size is 4096 bytes
*** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
bind(): Permission denied [core/socket.c line 230]
This does not happen, when creating the container for the first time or with other containers on the same machine.
A successful creation looks like this:
[uWSGI] getting INI configuration from /etc/uwsgi/apps-enabled/mat2-web.ini
*** Starting uWSGI 2.0.18-debian (64bit) on [Fri Nov 26 12:28:40 2021] ***
compiled with version: 8.2.0 on 10 February 2019 02:42:46
os: Linux-5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30)
nodename: docker1
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /var/www/mat2-web
detected binary path: /usr/bin/uwsgi-core
chdir() to /var/www/mat2-web/
your processes number limit is 31701
your memory page size is 4096 bytes
*** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /run/uwsgi/uwsgi.sock fd 3
Python version: 3.7.3 (default, Jan 22 2021, 20:04:44) [GCC 8.3.0]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x555997e8c020
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145840 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x555997e8c020 pid: 13 (default app)
mountpoint already configured. skip.
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 13)
spawned uWSGI worker 1 (pid: 16, cores: 1)