Never used a docker.
How to install PHP 7 with mongodb driver and apache module, so that each in its own docker container was.
And the main thing is how to tie it into a bundle to make it work?
Never used a docker.
How to install PHP 7 with mongodb driver and apache module, so that each in its own docker container was.
And the main thing is how to tie it into a bundle to make it work?
If you do not want to go deep into the docker and quickly start, I advise you to put https://docs.docker.com/compose/ right away. After that, you just need to use the following docker-compose.yml + Dockerfile (to install the pecl extension in php) at the root of your project:
docker-compose.yml
web: build: . dockerfile: Dockerfile links: ["mongo"] ports: - "80:80" volumes: - .:/var/www/html #создайте папку logs предварительно environment: - APACHE_LOG_DIR=./logs mongo: image: mongo ports: - "27017:27017" Dockerfile:
FROM php:7.0.6-apache # копируем ваш кастомный виртуал хост, по желанию ADD /path/to/your/apache2.conf /etc/apache2/apache2.conf RUN apt-get update && apt-get install -y \ libssl-dev \ && a2enmod rewrite \ && pecl install mongodb \ && docker-php-ext-enable mongodb And then docker-compose up -d and that's it. If there are errors - write, I will answer in the comments
Source: https://ru.stackoverflow.com/questions/527551/
All Articles