I am running into the problem that I do not get the apache container to listen on ipv4 it seem.
My docker-compose.yml
version: '3.2'
services:
nextcloud-aio-mastercontainer:
image: nextcloud/all-in-one:latest
container_name: nextcloud-aio-mastercontainer
restart: always
init: true
networks:
- net
- nextcloud-aio
ports:
- 50082:8080
volumes:
- /volume1/docker/nextcloud/nextcloud_aio/html:/var/www/html
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- APACHE_PORT=11000
- APACHE_IP_BINDING=0.0.0.0
- APACHE_ADDITIONAL_NETWORK=net
- NEXTCLOUD_DATADIR=/volume1/Nextcloud/data
- NEXTCLOUD_UPLOAD_LIMIT=10G
- NEXTCLOUD_MEMORY_LIMIT=4096M
- NEXTCLOUD_ENABLE_DRI_DEVICE=true
- SKIP_DOMAIN_VALIDATION=true
labels:
- "traefik.enable=true"
# Define Router for Nextcloud
- "traefik.http.routers.nextcloud.rule=Host(`sub.example.com`)"
- "traefik.http.routers.nextcloud.entrypoints=websecure"
- "traefik.http.routers.nextcloud.tls=true"
- "traefik.http.routers.nextcloud.tls.certresolver=cloudflare"
# HTTP to HTTPS Redirect
- "traefik.http.routers.nextcloud-http.rule=Host(`sub.example.com`)"
- "traefik.http.routers.nextcloud-http.entrypoints=web"
- "traefik.http.routers.nextcloud-http.middlewares=nextcloud-https@docker"
- "traefik.http.middlewares.nextcloud-https.redirectscheme.scheme=https"
# Point Traefik to Nextcloud Apache
- "traefik.http.services.nextcloud.loadbalancer.server.port=11000"
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer
networks:
net:
external: true
nextcloud-aio:
external: true
Notes:
- The reason I have two networks is because my other services use net when connected to Traefik.
- Traefik is connected to both nextcloud_aio and net
The output of docker exec -it nextcloud-aio-apache netstat -tulnp
gives me
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.11:36828 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 38/httpd
tcp 0 0 127.0.0.1:2019 0.0.0.0:* LISTEN -
tcp 0 0 :::11000 :::* LISTEN -
udp 0 0 127.0.0.11:38596 0.0.0.0:* -
The output of docker exec -it nextcloud-aio-mastercontainer netstat -tulnp
:
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 152/httpd
tcp 0 0 127.0.0.1:2019 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.11:38116 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 152/httpd
tcp 0 0 127.0.0.1:9876 0.0.0.0:* LISTEN -
tcp 0 0 :::9000 :::* LISTEN 157/php-fpm.conf)
tcp 0 0 :::80 :::* LISTEN -
tcp 0 0 :::8443 :::* LISTEN -
udp 0 0 127.0.0.11:60860 0.0.0.0:* -
Traefik log tells me the following where 172.21.0.2 is the ip for nextcloud-aio-mastercontainer.
2025-03-01T05:53:31+02:00 DBG github.com/traefik/traefik/v3/pkg/server/service/loadbalancer/wrr/wrr.go:213 > Service selected by WRR: http://172.21.0.2:11000
2025-03-01T05:53:31+02:00 DBG github.com/traefik/traefik/v3/pkg/proxy/httputil/proxy.go:115 > 502 Bad Gateway error="dial tcp 172.21.0.2:11000: connect: connection refused"
172.18.0.1 - - [01/Mar/2025:03:53:31 +0000] "GET /index.php/204 HTTP/2.0" 502 11 "-" "-" 2219 "nextcloud@docker" "http://172.21.0.2:11000" 1ms
I’d really appreciate some help as I’m either too caffeinated by now, or just did something very stupid.
Cheers