Issue using docker-compose.override.yml

I have tutor installed on a server that has a number of other containers running, and thus need it to not hog ports 80 and 443 on all possible addresses. To make it cooperate nicely, I created a $(tutor config printroot)/env/local/docker-compose.override.yml file with the following contents:

services:
  caddy:
    image: docker.io/caddy:2.7.4
    restart: unless-stopped
    ports:
      - "192.168.0.10:80:80"
      - "192.168.0.10:443:443"
      - "192.168.0.10:443:443/udp"

    environment:
      default_site_port: ""
    volumes:
      - ../apps/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - ../../data/caddy:/data

Just a copy of docker-compose.prod.yml with added IP addresses so the caddy container uses only that IP/port combination.

As is, it does not work - the container is still trying to use 0.0.0.0:80 and 0.0.0.0:443, as witnessed by the error message:

Error response from daemon: driver failed programming external connectivity on endpoint tutor_local-caddy-1 (6ab47aafb0c1bc8eec52d2db1c55754fbcdcc577cbf9d8e3a4b63c1140ae9ca6): Error starting userland proxy: listen tcp4 0.0.0.0:443: bind: address already in use

If I copy docker-compose.override.yml to docker-compose.prod.yml, the container starts fine, and plays well with others - but of course that gets blown away every time I run tutor config save.

From the documentation at Local deployment — Tutor documentation, I was under the impression that docker-compose.override.yml should override docker-compose.prod.yml. Is that not the case, or do I have to do something extra to make this work?

Thanks.

Hi @juergen,
The official recommendation is not to install other services in the same server as Open edX. Of course you can modify everything, but it might lead to unpredictable results.
Another recommendations, do not modify anything inside the env directory, as tutor config save may overwrite your canges. Instead make your customizations in a Tutor plugin.

Thank you.

I am quite new at this. Assuming that Management won’t spring for a dedicated server for Open edX, where do I find documentation on how to change the IP/port settings for Caddy?
While I have already added two patches to our system (one of them completely cut-n-pasted), the whole catalog of patchable items is still a bit confusing to me.

Thanks.

You don’t set IP addresses on Caddy, it’s the host’s interface property. Check here for more about Caddy configuration and port settings.

I understand. I set the Docker configuration that governs the forwarding to the relevant ports to the Caddy container, which normally goes into docker-compose.prod.yml.

I was hoping to alter the settings using docker-compose.override.yml - but that does no see to work, or maybe I am doing it wrong.

docker-compose.prod.yml being in the env/ directory probably means that it is patchable, right?

Thanks.

Yes it is!