M
M
markmoskalenko2017-09-10 11:18:47
Docker
markmoskalenko, 2017-09-10 11:18:47

How to make a common console for all containers in docker?

Good afternoon!
Tell me how I can make a certain connecting container when I connect to which I will get access to all the important cli commands.
For example, I currently have 3 containers:

  • nginx
  • mysql
  • php-fpm + composer

Now, to get access to mysql, I need to connect to the mysql container, if I update composer or perform migrations, then to php-fpm. And let's say I also add npm, bower, gulp, then I need to keep several consoles at hand at all times!?
My docker-compose.yml
version: '2'
services:
  nginx:
    image: jboesl/docker-nginx-headers-more
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - $PWD/:/site
      - $PWD/docker/nginx:/etc/nginx/conf.d
    expose:
      - "80"
    links:
      - fpm
  fpm:
    build: $PWD/docker/php
    expose:
        - "9000"
    volumes:
      - $PWD/:/site
    links:
      - mysql
  mysql:
      image: mysql
      ports:
        - "3306:3306"
      environment:
          MYSQL_ROOT_PASSWORD: "root"
          MYSQL_DATABASE: "homeworks5"
          MYSQL_USER: "app"
          MYSQL_PASSWORD: "app"
      volumes:
        - mysqldata:/var/lib/mysql
volumes:
  mysqldata:
    driver: "local"

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question