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

359
Vistas
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 Respuestas
Responde la pregunta

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 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