How in docker-compose do I bind a specific host IP address to a docker service if I want to send any http/https request from the docker service from that selected IP?
For example host server has eth0, eth0:1, eth:0 and ip 192.168.0.2 (default ip) and 192.168.0.3
I would like to send any http/https request from the specific docker service via IP - 192.168.0.3, but in the same time this service should keep connection to the Redis service in the docker.
services:
backend:
build: .
ports:
- 80:3000
- 9229:9229 # debugger port
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- redis
command: yarn start:docker
environment:
PORT: 80
redis:
image: redis:6.0.16-alpine
privileged: true
ports:
- 6379:6379
volumes:
- ${PWD}/data/redis:/data
- ${PWD}/redis.conf:/etc/redis.conf