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
.gitlab-ci.yml:
...
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?
В чем фишка, если перезапущу Pipeline в гитлабе, все работает как надо.