Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

110
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda