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

356
Visualizações
Can and should Node/NPM be used in a separate container for a dockerized PHP application

I am creating a dockerized PHP application and would like to separate the services as much as possible. I so far have separate nginx, mysql and php containers (which are all working correctly). However I am wondering where node/npm fits into this? I have npm packages for the the frontend and gulp tasks for the build etc.

I was wondering if it was best practice to then have a separate Node container that runs npm install / gulp? This seems the most appropriate, however I haven't seen any examples of anyone doing this! Plus when I did try this I had a lot of problems with the node_modules, but that's a story for another time!

Here is an example of my docker-compose file

version: '2'

services:
    nginx:
      build: './nginx'
      ports:
          - '8080:80'
  restart: always
  volumes:
      - '.:/app'
      - './nginx/app.conf:/etc/nginx/conf.d/app.conf'
php:
  build: './php'
  volumes:
      - '.:/app'
      - './nginx/app.conf:/etc/nginx/conf.d/app.conf'
mariadb:
  image: mariadb:10.0
  ports:
      - '3310:3306'
  volumes:
      - './mariadb:/var/lib/mysql'
  environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_DATABASE=database_name
node:
  image: node:boron
  volumes:
    - '.:/app'
    - /app/node_modules
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I'm currently working on a dockerized MEAN application (using docker-compose), there you will find how I handle the separation of a Node.js webserver (based on mhart/alpine-node image) and the MongoDB database.

https://github.com/alex-gru/docker-MEAN-ts-starter

Hope this helps!

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