I have a docker-compose.yml that contains a few machines:
- hat (my python+react app)
- db (postgresql)
- couchdb
- redis
My bitbucket pipelines is:
image: python:3.6
options:
docker: true
pipelines:
default:
- step:
script:
- curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose
- docker-compose build
- PGDATA=./pgdata docker-compose up -d db couchdb redis
- PGDATA=./pgdata docker-compose run hat test_python
services:
- docker
caches:
- docker
definitions:
services:
docker:
memory: 2048
PGDATA is overriding the volume path that is usually ../pgdata (forbidden in bitbucket, obviously)
Since hat depends on the others, I only added the docker-compose up to check why it was failing.
When I run these commands locally on my mac, no problem, everything runs smoothly. When I run it in pipelines, the "run hat test_python" starts with a wait_for_dbs.sh:
#!/bin/bash
set -e
# Simple script to wait for DBs to have been started
until psql -h "db" -U "postgres" -c '\l' > /dev/null; do
>&2 echo "Waiting for postgres..."
sleep 1
done
until curl -s "http://couchdb:5984" > /dev/null; do
>&2 echo "Waiting for couchdb..."
sleep 1
done
The psql part works fine but the curl thing loops forever. If I remove the -s, I get:

My docker-compose was using links and someone suggested to switch to networks. Didn't change anything.
I don't have a clue what could be making the Bitbucket Pipelines differ from what I have nor how to investigate. Any suggestion ?