Using --scale causes the IP of the api container to be used
DyLaiT opened this issue · 0 comments
DyLaiT commented
Hi,
Just a small boot sequence issue.
When I execute scalable function, api container will get error "
Address already in use".
~/lisa$ docker-compose up --scale worker=10
Recreating lisa_worker_1 ... done
Recreating lisa_worker_2 ... done
Recreating lisa_worker_3 ... done
Recreating lisa_worker_4 ... done
Recreating lisa_worker_5 ... done
Recreating lisa_worker_6 ... done
Recreating lisa_worker_7 ... done
Recreating lisa_worker_8 ... done
Recreating lisa_worker_9 ... done
Recreating lisa_worker_10 ... done
Starting lisa_mariadb_1 ... done
Starting lisa_rabbitmq_1 ... done
Recreating lisa_api_1 ... error
ERROR: for lisa_api_1 Cannot start service api: Address already in use
ERROR: for api Cannot start service api: Address already in use
ERROR: Encountered errors while bringing up the project.
Here I think it is because api has set ipv4 and depends_on worker in advance, which causes worker to occupy the IP first after it starts.
So I made worker wait for api to finish booting before starting.
api:
image: lisa-api
depends_on:
- rabbitmq
worker:
image: lisa-worker
depends_on:
- api