V
V
VicTHOR2021-01-31 15:24:01
Docker
VicTHOR, 2021-01-31 15:24:01

How to use binaries in a container? How to develop in a container?

Let's say I do docker-compose with services: nginx, php-fpm, composer, nodejs..
In the VS Code editor, I can connect to one container (for example, php), but I can't use other services (composer, npm) from it.. This is the same as running in interactive mode, but the working environment is loaded there.
It turns out that I need all these binaries in one container, is there any other way? And if they are needed in one container, then how to install them? How to transfer the version of the service in the Dockerfile, for example, from doker-compose to the RUN section, through which I will install these php nodejs, etc. from some, conditionally, Ubuntu? I tried to specify in the docker-compose environment, and in the Dockerfile I specified ${PHP_VERSION}, but in the console it just printed out ${PHP_VERSION}
Or is it correct how many services, how many windows to open, how many terminals to open? In terms of working with the editor, it’s easier to copy virtual machines as needed, in my opinion.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-02-01
@VicTHOR

Well, containers are actually made in order to isolate the system environment and not depend on each other in this regard.
Perhaps you have something wrong with the architecture, since this creates problems.
nginx is a web server that interacts with your project, the fastest - at the
php-fpm socket level, composer - I'm not very into the php topic - but it seems to me it would be more correct to combine it in one container ...
nodejs is another history - and the fastest you use it to assemble the front.
All of these are isolated entities. You don’t need nginx and php to build the front, and you don’t need nodejs for the web server to work ....
And why you need all this in the context of one container is not entirely clear ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question