Hello fellows, I’m facing a problem with configuration in docker-compose.yml
file, I want to connect the postgres and the web (django project) in order to retrieve data, so this it my file
version: "3.7"
services:
web:
build: .
restart: always
command: >
sh -c "
python app/manage.py collectstatic --noinput --clear --settings=dashboard.settings && \
xvfb-run -a python app/manage.py runserver 0.0.0.0:8000 --settings=dashboard.settings"
environment:
- POSTGRES_NAME=dash
- POSTGRES_USER=db
- POSTGRES_PASSWORD=cau****
- DISPLAY=0
- QT_X11_NO_MITSHM=1
volumes:
- ./dashboard:/app
- ./faces:/app/faces
- /tmp/.X11-unix:/tmp/.X11-unix
ports:
- "8000:8000"
devices:
- "/dev/video0:/dev/video0"
privileged: true
networks:
- dash_net
depends_on:
- db
cap_add:
- SYS_ADMIN
- DAC_READ_SEARCH
security_opt:
- seccomp:unconfined
db:
image: postgres:13
command: ["postgres", "-c", "log_statement=all"]
restart: always
volumes:
- "db:/var/lib/postgresql/data"
networks:
- dash_net
environment:
- POSTGRES_USER=db
- POSTGRES_PASSWORD=ca*****
- POSTGRES_HOST=dash.postgres.****
ports:
- "5432:5432"
networks:
dash_net:
driver: bridge
volumes:
db: