S
S
Sergey Chazov2020-08-06 20:15:42
Docker
Sergey Chazov, 2020-08-06 20:15:42

How to automatically run Laravel migrations when docker is raised?

i want migrations to run in my created container after running docker-compose up

php-fpm:
    image: webdevops/php-dev:7.3
    hostname: php-fpm
    volumes:
      - "./:/app"
    working_dir: "/app"
    depends_on:
      - db


I tried to run via command. type:
command: php artisan migrate:fresh --seed

but after executing this command, the container stops for some reason ...
Please, see an example of how to do this correctly?

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