Docker container conflict

Hey guys.

I’m using the new resource manager to try some custom configs I use and getting the following error on deploy.

Wappler is detecting that I have another container running already, which is correct. This container has Caddy Server running and it does in fact have control of ports 80 and 443 as it will reverse proxy to the node app.

I have removed port 80 and 443 from the docker-compose of the web app.

If I take the Caddy container down, then I can deploy just fine. And when I bring the Caddy container back up, everything works as expected.

However, the reason I am running Caddy in a separate container is that it generates a nice maintenance page during the nodeapp deployment (or whenever the node app is down.)

So, my question is, can this conflict detection be improved to only check for port 80 and 443 if they are actually referenced in the docker-compose file for the target? Or, an option to disable this check in the target settings?

@George Thoughts on this?

If you use Caddy as reverse proxy then there is indeed no need to expose the public ports in your web project. So you can just leave them empty. A bit like when using Traefik which essentially does also reverse proxy. See:

Does that work for you?

Thanks @George

I thought that is what I did by modifying the docker-compose:

version: '3'
services:
 web:
   ports:
     - '3000'
   restart: 'always'
   stdin_open: true
   tty: true
   logging:
     options:
       max-file: '5'
       max-size: '10m'
   build:
     context: '../../../'
     dockerfile: '.wappler/targets/Staging-DO/web/Dockerfile'
   networks:
     - webnet
     - internal
 redis:
   image: 'redis:alpine'
   hostname: 'redis'
   volumes:
     - 'redis-volume:/data'
   networks:
     - webnet
     - internal
volumes:
 redis-volume: ~
networks:
 webnet:
   external: true
 internal: ~

Did I miss something?

Oh wait, I see. The port 80 in the config.

It’s working now.

Well this is what I linked in the article above that you can chance in the docker target settings UI:

So just leave the port there empty

1 Like

Yep, my bad. I thought by removing port 80 inside the yml file, that would take care of it…but obviously it did not.

Thanks for the help.