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

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

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