R
R
Romi2021-09-11 23:43:45
bash
Romi, 2021-09-11 23:43:45

How to make a bash script continue running inside docker-compose?

There is a shell script:

#!/bin/bash
docker-compose up -d nginx mysql phpmyadmin
docker-compose exec --user=laradock workspace bash
cd laravel
$SHELL


he does everything fine except

cd laravel

, as I understand it, this is somehow related to the script execution context.

Is it possible to sort this out somehow? Well, to do something so that after entering the container, the commands in the script continue to be executed?

// if you type cd laravel with your hands, it normally goes to this directory.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2021-09-12
@romicohen

Add a script to the container that will perform the actions you need and run it inside the container with docker-compose exec, that is, just like you are now running bash.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question