I have made a dockerfile and docker-compose file that run a node.js application. My plan was to use it for testing out scaling with replicas without fancy load balancers.
My app works well when I start it with sudo docker-compose -p "myapp" up
. Than I bring it down before trying to deploy it with:
sudo docker-compose -p 'myapp' down --volumes
sudo docker-compose -p 'myapp' push
If I than run:
sudo docker stack deploy -c docker-compose.yml 'myapp'
it gives me this error and I don't understand what could be causing it or how to troubleshoot it:
1 error(s) decoding:
* error decoding 'Ports': No port specified: :<empty>
This is my docker-compose.yml:
version: '3.3'
services:
app:
build: ./
restart: always
env_file: ./.env
ports:
- 3306:3306
network_mode: host
stdin_open: true
tty: true
deploy:
mode: replicated
replicas: 12
update_config:
parallelism: 11
volumes:
db:
I was roughly following this tutorial.