H
H
HoHsi2016-03-22 07:16:15
PHP
HoHsi, 2016-03-22 07:16:15

How to make friends between Docker nginx and PHP-FPM?

Good afternoon!
How to properly configure Docker (or docker-compose) so that Nginx (from a separate container) handles a PHP-FPM application?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kompi, 2016-03-22
@kompi

I have something like this to run nginx/php-fpm/mariadb in docker-compose.yml:

version: '2'

services:
  mariadb:
    container_name: mdb10
    build: ./../../mariadb
    volumes:
      - ./../../shared/mysql_ext_data:/var/lib/mysql/mysql_ext_data
    ports:
      - "3306:3306"

  php5x:
    container_name: php5x
    build: ./../../php-fpm-5X
    volumes:
      - ./../../php-fpm-5X/confs:/etc/php5/fpm/pool.d
      - ./../../shared/www:/var/www
      - ./../../shared/socks:/var/run/socks
    depends_on:
      - mariadb

  nginx18:
    container_name: nginx18
    build: ./../../nginx
    ports:
      - "80:80"
    volumes:
      - ./../../nginx/confs:/etc/nginx/conf.d
      - ./../../shared/www:/var/www
      - ./../../shared/socks:/var/run/socks
    depends_on:
      - php5x

As can be seen from the config, sockets are rummaged between php-fpm and nginx through a shared host folder.

I
Igor Alyakimov, 2016-03-22
@kaiten

https://docs.oracle.com/cd/E52668_01/E54669/html/s...
And many other articles on using the --link option

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question