K
K
knowledge2019-01-09 14:42:48
Docker
knowledge, 2019-01-09 14:42:48

How can php and mysql be reached in a docker container?

snippet docker-compose.yml

services:
    web:
        image: debian.loc
        volumes:
            - .:/app
        links:
            - php
    php:
        image: php:7.3-fpm
        volumes:
            - .:/app
        ports:
            - "9000:9000"

debian.loc image Dockerfile
FROM debian:9.3
RUN apt-get install nginx-full

after starting the container docker-compose up -d and entering it docker-compose exec web bash
I enter nginx -v # gives out the version of nginx
I enter php -v # php is not installed
Tell me, maybe something needs to be registered, how to do it from the container could you run php?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2019-01-09
@knowledge

Of course, there is no php in the web container - it is in the php container
. But, probably, there is no bash there and there is no option to go inside the container - only php.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question