Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How could i access to another container?

stellarweb-studio
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2019

I tried to build some testing process for my app, using Bitbucket pipelines.

The core testing tool is Cypress. I want to set up several docker containers and execute Cypress to test my app.

So, my bitbucket-pipelines.yml looks like this:

image: docker:stable

options:  docker: truepipelines:
  default:
    - step:        
name
: Install PHP app caches: - composer script: - cp config/db.sample.php config/db.php - sed -i "s/[HOSTNAME]/db/" config/db.php - sed -i "s/[DB_NAME]/dbname/" config/db.php - sed -i "s/[DB_USER]/usr/" config/db.php - sed -i "s/[DB_USER_PASSWORD]/pass/" config/db.php - cp web/index.sample.php web/index.php - docker run --name db --restart always -e MYSQL_DATABASE=dbname -e MYSQL_USER=usr -e MYSQL_PASSWORD=pass -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d -p 3306:3306 mariadb - docker run --name web -v="$BITBUCKET_CLONE_DIR:/app" -d -p 8000:80 yiisoftware/yii2-php:5.6-apache - docker run --name e2e -v="$BITBUCKET_CLONE_DIR:/app" --workdir /app --tty -d cypress/base:10 - docker exec -i web composer install - docker exec -i db mysql -uroot dbname < ./migrations/data/structure.sql - docker exec -i e2e yarn install - docker exec -i e2e yarn run cypress run --config baseUrl=http://web --project ./ services: - docker - web definitions:
services
:
db
:
image
: mariadb web:
image
: yiisoftware/yii2-php:5.6-apache e2e:
image
: cypress/base:10

Overall, it works almost good, but for some reason I can't get access to web service inside e2e container. I tried to use container name, like http://web, but it doesn't work.

photo_2019-06-28_15-15-57.jpgWhat is wrong here?

1 answer

0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 18, 2019

Hi @stellarweb-studio

I'm not sure if I can help you with this one, but I'm curious about something.
How is Cypress resolving the address http://web?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events