M
M
Maxim Fedorov2018-02-14 10:37:06
Docker
Maxim Fedorov, 2018-02-14 10:37:06

How to fork a container with MySQL bypassing the ports setting in docker-compose.yml?

Situation:
The company moved the folder with the Docker config settings to the same folder with the application and to the same GIT repo (there were 2 separate ones)
Problem:

  • Everyone works with MySQL through the phpmyadmin and adminer containers, and therefore does not want to forward ports to MySQL outside
  • I want to work with the database through PHPSTORM, but I constantly need to edit the config for the database container, this is how I do it:
ports:
    - 3306:3306

Because of this, I have a permanently changed config file, which GIT swears at and to switch branches, I need to edit it back ... krch is not convenient at all ...
Questions:
  • How can I run it so that the ports for the database container are forwarded? Can eat flags for start convenient for a command docker compose up?
  • Can this be done without editing the config, or is there a way to solve my problem through GIT?
  • I tried to make Binding Ports for the database container in Storm, I get access, but the connection to the database falls inside the container, maybe there is an option?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alfss, 2018-02-14
@Maksclub

docker-compose.override.yml https://docs.docker.com/compose/extends/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question