When I run this docker compose yaml file to create a multi-container app it creates a new volume called algo_trading_algo_data instead of attaching an existing volume called algo_data.
As a result the bot_hl_test2 container fails because it can’t find a file.
If I create a single container bot_hl_test the correct volume (algo_data) is attached and the container works. Any suggestions please?
name: algo_trading
services:
ibeam:
image: voyz/ibeam
container_name: ibeam
env_file:
- ibeam/env.list
ports:
- 127.0.0.1:5000:5000
- 127.0.0.1:5001:5001
network_mode: bridge # Required due to clientportal.gw IP restrictions
restart: ‘no’ # Prevents IBEAM_MAX_FAILED_AUTH from being exceeded
bots:
image: bot_hl_test
volumes:
- algo_data:/var/lib/docker/volumes/algo_data/_data
container_name: bot_hl_test2
depends_on:
- ibeam
networks:
- default
volumes:
algo_data:
networks:
default:
driver: bridge
volume mount on bot_hl_test2 in the multi-container app
“Mounts”: [
{
“Type”: “volume”,
“Source”: “algo_trading_algo_data”,
“Target”: “/var/lib/docker/volumes/algo_data/_data”,
“VolumeOptions”: {}
}
],
volume mount in bot_hl_test single container which works
“Mounts”: [
{
“Type”: “volume”,
“Name”: “algo_data”,
“Source”: “/var/lib/docker/volumes/algo_data/_data”,
“Destination”: “/data”,
“Driver”: “local”,
“Mode”: “z”,
“RW”: true,
“Propagation”: “”
}
],