There is no internet in containers. Also, apparently, nginx has some problems with fpm, if you look at the logs, you can see the following error:
2020/03/30 15:55:21 [error] 6#6: *4 connect() failed (113: No route to host) while connecting to upstream, client: 10.0.2.2, server: , request: "GET /wpad.dat HTTP/1.1", upstream: "fastcgi://172.18.0.2:9000", host: "wpad.beeline"
All this works on VirtualBox on CentOS 8, network settings: https://i.imgur.com/apXpS4b.png
nginx/default:
server {
listen 80;
index index.php index.html;
root /app/public;
location / {
try_files $uri /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass manager-php-fpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
nginx.docker:
FROM nginx:1.17.9-perl
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
WORKDIR /app
php-cli.docker:
FROM php:7.4-cli
RUN apt-get update && apt-get install -y unzip
WORKDIR /app
COPY ./ ./
php-fpm.docker
FROM php:7.4-fpm
WORKDIR /app
docker-compose.yml:
version: '3'
services:
manager-nginx:
build:
context: ./manager/docker/development
dockerfile: nginx.docker
volumes:
- ./manager:/app
depends_on:
- manager-php-fpm
ports:
- "80:80"
manager-php-fpm:
build:
context: ./manager/docker/development
dockerfile: php-fpm.docker
volumes:
- ./manager:/app
manager-php-cli:
build:
context: ./manager/docker/development
dockerfile: php-cli.docker
volumes:
- ./manager:/app
If in php-cli.docker add
RUN apt-get update && apt-get install -y unzip
there will be an error with the package manager
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
The virtual machine resolve DNS names https://i.imgur.com/OiyHpO9.png
For some reason there are no containers
[iam@localhost ~]$ docker network inspect bridge
[
{
"Name": "bridge",
"Id": "bf73901df41df980c3619a2eb9281039edd09dab4768468fa08487e3f4d248b2",
"Created": "2020-03-30T17:47:12.591249611-04:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]