Is it possible to use docker in a server that runs apache?

I want to install ghost (again), this time using docker compose (I used to run it with node in debian, but it was always complicated). The problem is that I have more websites running on that server (moodle, wordpress, etc) and I’m using apache. I read other websites that said that caddy could not run on another ports, that it’s need 80 and 443 but those are used by apache. I have other stuff with docker too. Is it possible to map caddy ports 81:80 or 444:443)?

Or could I use an apache reverse proxy commenting the caddy stuff on the compose.yml?

Thanks!

Assigning port 81 and 444 to Caddy will work from a technical perspective, but it will not have the desired results. Port 80 and 443 are standard ports for HTTP and HTTPS connections.

This is rather the way to go about this.

Thanks for your answer. I made that change (commenting all about caddy service) and the only thing I need to add was to include

ports:
  - "2368:2368"

to compose.yml so apache could see it. I will need to find the way to have a subdomain for admin, but now it’s working.

I’s still fighting to make ActivityPub to work in this environment. I suppose I have to add some other proxy in Apache to port 8080, but I don’t understand which type of configuration should I add to route to the path on the server

Yes, you need to proxy the activitypub traffic.

This patch shows the needed settings in nginx, which may help you figure out what you need to do in Apache: Added activitypub path to nginx by rmgpinto · Pull Request #1963 · TryGhost/Ghost-CLI · GitHub

Thanks, I just make it work adding these lines to the apache.conf:

ProxyPass /.well-known/webfinger http://0.0.0.0:8080/
ProxyPass /.ghost/activitypub/ http://0.0.0.0:8080/
ProxyPass / http://0.0.0.0:2368/
ProxyPassReverse / http:/0.0.0.0:2368/

(I need to try with 127.0.0.1)

I have another problem now, but that is for another thread.

Thanks!