B
B
bondle2020-08-01 09:51:10
Docker
bondle, 2020-08-01 09:51:10

How to perform migrations via docker?

In a Symfony project, composer, nginx, php, mysql are loaded in docker-compose. You need to execute the command with docker-compose up, but after loading the database. How can I do that?

docker-compose exec php bin/console doctrine:migrations:migrate

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-08-01
@myks92

You must be running the php used in docker. For example,

docker-compose run --rm api-php-cli php bin/console doctrine:migrations:migrate --no-interaction

Where, api-php-cliis the name of the php-cli container from docker.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question