Part 8 - Working with Multiple Containers using Docker Compose



In this video we will learn how to work with Multiple Containers using Docker Compose yaml file.

This video is more like Part 6, but is much refined and easier to work with multiple containers.

#ExecuteAutomation #Docker #Containers #Testing #Selenium
Please hit like and share your comments about the video !!!
For more videos and articles visit
Subscribe: ExecuteAutomation channel in Youtube !!!

source

38 thoughts on “Part 8 – Working with Multiple Containers using Docker Compose”
  1. getting below issue. Is something updated ?

    Error:
    Attaching to wordpresssite_db_1, wordpresssite_wordpress_1

    db_1 | 2021-02-21 19:25:28+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.

    db_1 | 2021-02-21 19:25:28+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'

    db_1 | 2021-02-21 19:25:28+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.23-1debian10 started.

    wordpress_1 | [21-Feb-2021 19:25:33 UTC] PHP Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22

    wordpress_1 |

    wordpress_1 | MySQL Connection Error: (2002) Connection refused

    db_1 | 2021-02-21T19:25:29.400338Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 1

    db_1 | 2021-02-21T19:25:29.504399Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

    db_1 | 2021-02-21T19:25:31.520772Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

    db_1 | 2021-02-21T19:25:32.066824Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock

    db_1 | 2021-02-21T19:25:33.207291Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.

    db_1 | 2021-02-21T19:25:33.207817Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.

    db_1 | 2021-02-21T19:25:33.881947Z 0 [Warning] [MY-011810] [Server] Insecure configuration for –pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.

    db_1 | 2021-02-21T19:25:33.925032Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.23' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server – GPL.

    wordpress_1 | [21-Feb-2021 19:25:36 UTC] PHP Warning: mysqli::__construct(): (HY000/1130): Host '172.18.0.3' is not allowed to connect to this MySQL server in Standard input code on line 22

    wordpress_1 |

    wordpress_1 | MySQL Connection Error: (1130) Host '172.18.0.3' is not allowed to connect to this MySQL server

    docker-compose.yml
    version: "3.1"

    services:
      wordpress:
        image: wordpress
        restart: always
        ports:
          – "8080:80"
        links:
          – db
        environment:
          WORDPRESS_DB_HOST: db
          WORDPRESS_DB_USER: exampleuser
          WORDPRESS_DB_PASSWORD: examplepass
          WORDPRESS_DB_NAME: exampledb

      db:
        image: mysql
        restart: always
        command: –default-authentication-plugin=mysql_native_password
        environment:
          MYSQL_DATABASE: exampledb
          MYSQL_USER: exampleuser
          MYSQL_PASSWORD: examplepass
          MYSQL_RANDOM_ROOT_PASSWORD: "1"

  2. A great video, thanks! When I try and open in the browser thought I get this error:
    Invalid HTTP_HOST header: 'localhost:8000'. You may need to add u'localhost' to ALLOWED_HOSTS.
    I can't find a solution. Any idea why I get this? I tried adding it to my ALLOWED_HOST but still not solved. Thanks! 😊

  3. WordPress service is trying to connect to mysql service which is not ready yet so it fails and exits, so you need to write that wordpress depends_on the MySQL so it will not run before mysql is ready

  4. I enter > docker-compose ps

    PS C:wordpressSite> docker-compose up

    ERROR: yaml.scanner.ScannerError: mapping values are not allowed here

    in ".docker-compose.yml", line 2, column 9
    can someone give me a clue on to why this is not working… ?

  5. I love when tutorial clips have errors left in so we get some bonus troubleshooting action. I also try to include imperfect cases in my training lessons. Thanks (y)

  6. Kartik while creating .yml file you should first mention the dependency app at the top and then list important or dependant should come underneath. Nice content …. Thank you

  7. Nice video but i am still getting the error mysql connection errror saying connection refused even though both the services are up and running
    Please help
    I tried many port numbers but still error exists

  8. Hi , i was trying to execute the same yml file and getting error "yaml.scanner.ScannerError: mapping values are not allowed here in ".docker-compose.yml", line 12, column 20" . please let me if you could help me.

  9. yaml.parser.ParserError: while parsing a block mapping
    in ".docker-compose.yml", line 5, column 3
    expected <block end>, but found '<block mapping start>'
    in ".docker-compose.yml", line 12, column 4

    i am getting this above error

  10. Thanks for your videos!
    I`m getting error when I`m running this YML file:

    version: '2'

    services:

    wordpress:
    image: wordpress
    ports:
    – 8080:80
    enviroment:
    WORDPRESS_DB_PASSWORD: abc123

    mysql:
    image: mysql:latest
    enviroment:
    MYSQL_ROOT_PASSWORD: abc123

    Error Message:
    ERROR: yaml.parser.ParserError: while parsing a block collection
    in ".docker-compose.yml", line 8, column 7
    expected <block end>, but found '?'
    in ".docker-compose.yml", line 9, column 7

  11. Thanks for the introduction, that helped quite a lot! But I think, that one more video could be done here – how to use already existing wordpress installation with existing database intead setting everything up from the ground. For example, now I tottaly see the use of the Docker, and I would like to migrate all my projects away from Valet (before that used MAMP or homestead or another virtual machine method)

  12. Nice tutorial. In my case i have cloned the docker compose file from github and the started the containers using docker-compose up and it up and running . ports are exposed properly. but when i try to browse the ip in localhost i get connection timeout error.
    I could not figure out what could be the issue.

  13. yml.file getting error ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
    in ".docker-compose.yml", line 7, column 10

    version: '2'

    services:

    wordpress:
    image: wordpress
    ports:
    – "8080:80"
    environment:
    – WORDPRESS_DB_PASSWORD=abc123

    mysql:
    image: mysql:latest
    environment:
    – MYSQL_ROOT_PASSWORD=abc123

Leave a Reply

Your email address will not be published.

Captcha loading...