Hi everyone i was working in a django project with docker. and i have a problem to connect docker container with postgres database, one the the way to connect is network_mode: host but i want to connect using custom network.
version: '3.3'
services:
web:
restart: always
container_name: main
command:
- /bin/bash
- -c
- |
python manage.py makemigrations accounts
python manage.py migrate
python manage.py runserver
image: main
build: .
volumes:
- .:/main
ports:
- "8000:8000"
extra_hosts:
- "dbhost:172.17.0.1"
networks:
- backend
networks:
backend:
volumes:
static: