Change network mode of containers to host. Add iproute2 package in php-fpm image

This commit is contained in:
RealBrandon 2024-04-19 20:26:09 +01:00
parent 87b343749d
commit 4723633bcc
3 changed files with 7 additions and 10 deletions

View file

@ -1,14 +1,11 @@
version: "3.8"
services: services:
nginx: nginx:
image: hybula/lookingglass-nginx:1 image: hybula/lookingglass-nginx:1
container_name: lg-nginx container_name: lg-nginx
build: build:
context: docker/nginx context: .
dockerfile: Dockerfile dockerfile: docker/nginx/Dockerfile
ports: network_mode: host
- "80:80"
restart: unless-stopped restart: unless-stopped
php-fpm: php-fpm:
@ -17,6 +14,7 @@ services:
build: build:
context: . context: .
dockerfile: docker/php-fpm/Dockerfile dockerfile: docker/php-fpm/Dockerfile
network_mode: host
restart: unless-stopped restart: unless-stopped
environment: environment:
# For a better reference as to what these variables do, check out 'config.dist.php' or 'docker/php-fpm/src/config.php'. # For a better reference as to what these variables do, check out 'config.dist.php' or 'docker/php-fpm/src/config.php'.
@ -39,8 +37,7 @@ services:
iperf3: iperf3:
image: networkstatic/iperf3:latest image: networkstatic/iperf3:latest
container_name: lg-iperf3 container_name: lg-iperf3
ports: network_mode: host
- "5201:5201"
command: -s command: -s
tty: true tty: true
stdin_open: true stdin_open: true

View file

@ -41,7 +41,7 @@ http {
location ~ \.php$ { location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php-fpm:9000; fastcgi_pass localhost:9000;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi.conf; include fastcgi.conf;
fastcgi_buffering on; fastcgi_buffering on;

View file

@ -1,7 +1,7 @@
FROM php:8.1-fpm-bullseye FROM php:8.1-fpm-bullseye
RUN apt-get update && \ RUN apt-get update && \
apt-get --no-install-recommends -y install iputils-ping mtr traceroute && \ apt-get --no-install-recommends -y install iputils-ping mtr traceroute iproute2 && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/html WORKDIR /var/www/html