docker-cabot icon indicating copy to clipboard operation
docker-cabot copied to clipboard

Problems with Mapping Non-Standard Port

Open plankconst opened this issue 5 years ago • 0 comments

I setup my Cabot docker container on Ubuntu 18.04 and a public IP address and port mapping to port: 8080. It all works fine with the following setup:

docker-compose-caddy.yml:

version: "2.1"

services:
  caddy:
	image: abiosoft/caddy
	ports:
	  - '80:80'
	  - '443:443'
	depends_on:
	  - web
	volumes:
	  - ./.caddy:/root/.caddy
	  - ./conf/Caddyfile:/etc/Caddyfile

and docker-compose.yml:

version: "2.1"

services:
  web:
	extends:
	  file: docker-compose-base.yml
	  service: base
	command: sh -c "cabot migrate && gunicorn cabot.wsgi:application -b 0.0.0.0$
	ports:
	  - '8080:5000'
	depends_on:
	  - postgres
	  - rabbitmq
	restart: always
	...

However, when the server's Port 80 is used by another web application on my server and I want to map Cabot to port 8080 locally and then to 8080 publicly, it doesn't work.

In other words, the mapping would be:

Public Port 8080 --> Caddy Port 8080 --> Cabot 5000

I tried to change docker-compose-caddy.yml:

version: "2.1"

services:
  caddy:
	image: abiosoft/caddy
	ports:
	  - '8080:80'
	  - '443:443'
	depends_on:
	  - web
	volumes:
	  - ./.caddy:/root/.caddy
	  - ./conf/Caddyfile:/etc/Caddyfile

I get this error:

Recreating 7bca6949339e_docker-cabot_caddy_1 ... error Recreating 7bca6949339e_docker-cabot_caddy_1 ...

ERROR: for 7bca6949339e_docker-cabot_caddy_1 Cannot start service caddy: driverCreating docker-cabot_worker_1 ... done eb631a2673cff2ea0982a77fef50c90c713b4e8ae75761afcee080d40f33): Bind for 0.0.0.0:Creating docker-cabot_beat_1 ... done

ERROR: for caddy Cannot start service caddy: driver failed programming

Am I configuring my configuration files correctly?

plankconst avatar Mar 17 '19 16:03 plankconst