# This doesn't work yet version: "3" services: postgres: image: postgres healthcheck: test: psql postgres --command "select 1" -U postgres ports: - "5432:5432" environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres init-postgres: build: . depends_on: - postgres environment: DATABASE_ADAPTER: docker_compose_postgres PACT_BROKER_HIDE_PACTFLOW_MESSAGES: 'true' INSTALL_PG: 'true' volumes: - ./lib:/home/lib - ./db:/home/db - ./tasks:/home/tasks - ./Rakefile:/home/Rakefile - ./config:/home/config command: dockerize --wait tcp://postgres:5432 /home/init-db.sh postgres-tests: build: . depends_on: - postgres environment: DATABASE_ADAPTER: docker_compose_postgres PACT_BROKER_HIDE_PACTFLOW_MESSAGES: 'true' INSTALL_PG: 'true' volumes: - ./lib:/home/lib - ./spec:/home/spec - ./db:/home/db - ./config.ru:/home/config.ru - ./tasks:/home/tasks - ./Rakefile:/home/Rakefile - ./config:/home/config - ./.rspec:/home/.rspec - ./.rubocop:/home/.rubocop - ./.gitignore:/home/.gitignore - ./public:/home/public mysql: image: mysql:5.7.28 command: --default-authentication-plugin=mysql_native_password environment: MYSQL_ROOT_PASSWORD: pact_broker MYSQL_DATABASE: pact_broker MYSQL_USER: pact_broker MYSQL_PASSWORD: pact_broker ports: - "3306:3306" init-mysql: build: . depends_on: - mysql environment: DATABASE_ADAPTER: docker_compose_mysql PACT_BROKER_HIDE_PACTFLOW_MESSAGES: 'true' INSTALL_MYSQL: 'true' volumes: - ./lib:/home/lib - ./db:/home/db - ./tasks:/home/tasks - ./Rakefile:/home/Rakefile - ./config:/home/config command: dockerize --wait tcp://mysql:3306 /home/init-db.sh mysql-tests: build: . depends_on: - mysql environment: DATABASE_ADAPTER: docker_compose_mysql PACT_BROKER_HIDE_PACTFLOW_MESSAGES: 'true' INSTALL_MYSQL: 'true' volumes: - ./lib:/home/lib - ./spec:/home/spec - ./db:/home/db - ./config.ru:/home/config.ru - ./tasks:/home/tasks - ./Rakefile:/home/Rakefile - ./config:/home/config - ./.rspec:/home/.rspec - ./.rubocop:/home/.rubocop - ./.gitignore:/home/.gitignore - ./public:/home/public