E
E
EvgMul2020-11-19 22:36:23
Docker
EvgMul, 2020-11-19 22:36:23

How to properly deploy docker?

Hello. The crux of the matter is as follows. I need to deploy a container with a website, and run a command in it that will launch the daemon I need.
DockerfileI have the following:

FROM yiisoftware/yii2-php:7.4-apache

WORKDIR /app

RUN docker-php-ext-install sockets

ADD . /app

#CMD ["/app/yii", "queue/listen"]

So the last commented command does what I need, but its execution leads to the closing of the container (which is logical).
Is there some way to execute the command I need and have the container continue its work?
Thanks in advance to all who respond.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zohan1993, 2020-11-20
@zohan1993

yii queue/listen - start processing the queue continuously (in daemon mode)
in theory the command should not end, add flags for more detailed output, the command may crash with an error

--verbose, -v: print executing statuses into console.
--isolate: verbose mode of a job execute. If enabled, execute result of each job will be printed.
--color: highlighting for verbose mode.

as an option - run "yii queue/listen" via supervisor / systemd
https://github.com/yiisoft/yii2-queue/blob/master/...
https://github.com/bscheshirwork/docker-yii2-app -a...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question