Docker for nginx and php-fpm -


i'm getting started docker , docker-compose

my first step build stack 2 containers : 1 nginx , 1 php-fpm

with config, it's working

version: '3.3' services:     web:         image: nginx         ports:             - "9090:80"         volumes:             - ./conf/default.conf:/etc/nginx/conf.d/default.conf:ro             - ./content:/usr/share/nginx/html:ro         links:             - php     php:         image: php:7.1.8-fpm         volumes:             - ./content:/usr/share/nginx/html:ro 

in /content have both index.html , phpinfo.php

i can both pages in browser.

but don't understand why have put pages in both containers ?

if don't put volume php service, index.html displaying not phpinfo.php (file not found.)

if don't put volume web service, nginx index.html displaying not phpinfo.php (404 error).

so if want deploy wordpress site have copy files in both containers ?

bad configuration. practice separate processes, should have 3 services: nginx, php-fpm , php. source code should inside php container.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -