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.