Answer the question
In order to leave comments, you need to log in
Why can't my container communicate with postgres?
docker-compose.test.yml:
version: '3'
services:
db:
image: postgres
web:
restart: always
image: $CONTAINER_TEST_IMAGE
command: python3 manage.py test --noinput
depends_on:
- db
...
test:
stage: test
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker-compose -f docker-compose.test.yml run web
- docker-compose rm -f web
tags:
- dev
...
could not connect to server: Connection refused
Is the server running on host "db" (172.22.0.2) and accepting
TCP/IP connections on port 5432?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question