Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

355
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!