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

388
Vistas
Dockerizing any Angular SPA app that runs in node

There are a lot of Angular 2+ templates (for example http://coreui.io/) that run fine in Node, simply by:

npm install
npm start

However, making them run in Docker container is a challenge. I tried the standard approach to creating dockerfile but this doesn't work

Should there be a simple way of dockerizing any app that runs on Node with?

What am I missing?

This is what my dockerfile looks like (generated by yo docker):

    FROM node:latest
    WORKDIR /src
    EXPOSE 4200
    ENTRYPOINT ["npm", "start"]
    COPY . /src
    RUN npm install
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

first thing i would suggest, don't use node:latest. what version of node do you normally run? specify that version.

you probably need to create the /src folder

and you should also change ENTRYPOINT to CMD

FROM node:7.9
RUN mkdir /src
WORKDIR /src

# cache the node modules for faster re-builds
COPY ./package.json /src
RUN npm install

COPY . /src

EXPOSE 4200
CMD ["npm", "start"]

this should cover the most basic of node apps.


things do get complex quickly, though. if you need more info on building out a proper dockerfile, i have a full course on docker with nodejs: https://sub.watchmecode.net/guides/build-node-apps-in-docker/

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