Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

119
Vistas
Why separated docker containers for ngnix and php?

Most of the times I see in the docker-compose.yml two separated services for ngnix and php, like this:

version: '3.3'

services:
  php:
    image: php
    ports:
      - "127.0.0.1:8000:8000"
    volumes:
      - ".:/code_folder"
    networks:
      - default

  ngnix:
    image: ngnix
    ports:
      - "127.0.0.1:80:80"
    volumes:
      - ".:/code_folder"
    networks:
      - default

I would assume there must be a single image having ngnix and php together but it's not a commonly used approach. Another question is: how does it works, since those will be separated containers, both mounting the same code base?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You're missing mapping your Nginx configuration file which is what makes the whole difference.

The configuration file specifies that all requests for PHP files should be passed on to the PHP container. All non-PHP files are served directly by the Nginx container.

over 4 years ago · Santiago Trujillo Denunciar

0

Because each container should run a single service. The design pattern should be it runs a service then when it completes it stops itself. It just happens that nginx and php need to continuously listen and therefor don't stop naturally

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda