Nextcloud AIO with docker-compose : unhealthy apache

Hello,

Here is my docker-compose.yml file :

version: "3.8"

services:
  nextcloud:
    image: nextcloud/all-in-one:latest
    restart: always
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 8080:8080
    environment: # Is needed when using any of the options below
      - APACHE_PORT=11000
      - APACHE_IP_BINDING=127.0.0.1
  caddy:
    image: caddy:alpine
    restart: always
    container_name: caddy
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - ./certs:/certs
      - ./config:/config
      - ./data:/data
      - ./sites:/srv
    network_mode: "host"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

and here is my Caddyfile :

{
    # email to use on Let's Encrypt
    email sysadmins@something.com

    # acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
    #debug
}

some.thing.com:443 {
    reverse_proxy localhost:11000
}

When I check my container, Apache’s state is : unhealthy
And nextcloud Office is not working, and sometime, the website is very slow.

I’m still trying to find something in the logs, but if someone see an obvious error in my config file, that would be appreciated!

Thanks!

Improved docker-compose.yml, with extra_hosts in the caddy section, now the link in the admin panel " [Open Nextcloud AIO Interface :arrow_upper_right:] works properly, but the rest of my issue persist :

version: "3.8"

services:
  nextcloud:
    image: nextcloud/all-in-one:latest
    restart: always
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 8080:8080
    environment: # Is needed when using any of the options below
      - APACHE_PORT=11000
      - APACHE_IP_BINDING=127.0.0.1
  caddy:
    image: caddy:alpine
    restart: always
    container_name: caddy
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - ./certs:/certs
      - ./config:/config
      - ./data:/data
      - ./sites:/srv
    network_mode: "host"
    extra_hosts:
      - "host.docker.internal:host-gateway"

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer

sudo docker exec -it nextcloud-aio-apache bash -x /healthcheck.sh

+ nc -z nextcloud-aio-nextcloud 9000
+ nc -z localhost 8000
+ nc -z localhost 443
+ nc -z redactedurl 443
+ exit 1

So apparently, this is a problem with my office firewall configuration (I got a different nmap result if I’m inside the office network or not …).