I have a docker-compose.yml file as such:
version: '3.8'
services:
python:
container_name: python
build: .
tty: true
networks:
- trade-net
depends_on:
- timescale
timescale:
image: timescale/timescaledb-ha:pg14-latest
container_name: timescaledb
ports:
- "5432:5432"
volumes:
- timescale-volume:/home/postgres/pgdata/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=mypass
networks:
- trade-net
networks:
trade-net:
driver: bridge
volumes:
timescale-volume:
When composing up both containers and inspecting my networks I find:
NETWORK ID NAME DRIVER SCOPE
a096327fe1f6 ark-sql_trade-net bridge local
f1d39a23ec84 bridge bridge local
eae37b1b17a0 host host local
1ec3159d2c48 none null local
f622d73b359f trade-net bridge local
So basically docker is creating a new network ark-sql_trade-net instead of using my own personal trade-net network to build the containers.