How to run docker-compose entrypoint configuration option with multiple or multiline bash commands
commands:
yarn install
yarn build
sleep infinity
How to run docker-compose entrypoint configuration option with multiple or multiline bash commands
commands:
yarn install
yarn build
sleep infinity
I figured out how!
Steps:
docker-compose.yml
, say for service:gvhservice
, add below lines of codeentrypoint.sh
Where in
entrypoint.sh
, add below lines of code:where in
docker-compose.yml
, add below lines of code:ENTRYPOINT
instruction within the container andcommand
instruction and operator|
configuration option indocker-compose.yml
(suitable for a variable number of commands to be passed during runtime)build you container with instruction:
COPY entrypoint.sh .
andwhere contents of
entrypoint.sh
is:where in
docker-compose.yml
, add below lines of code