Sorry if it sounds simple, but I checked all the other answers and they were way too complicated for Docker beginner. Even worse is that caddy.community site is down for last 2 days and I have a deadline.
Basically I have 2 different docker-compose projects, and one of them has to CURL to caddy port of other project.
The one that works as API and I need to access to is from this repo: https://github.com/dunglas/symfony-docker
Networks, expose, host.internal.docker… None of them worked or just got scrambled in my head.
For reference: I need HTTP only, HTTPS is not important. This is just for local development, production should be fine. This repo works perfect by setting SERVER_NAME to be "api.localhost:80"
Source: Docker Questions