-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (19 loc) · 851 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Comando obrigatório
## Baixa a imagem do node com versão alpine (versão mais simplificada e leve)
FROM node:alpine
## Define o local onde o app vai ficar no disco do container
## Pode ser o diretório que você quiser
WORKDIR /usr/app
## Copia tudo que começa com package e termina com .json para dentro da pasta /usr/app
COPY package*.json ./
## Executa npm install para adicionar as dependências e criar a pasta node_modules
RUN npm install
## Copia tudo que está no diretório onde o arquivo Dockerfile está
## para dentro da pasta /usr/app do container
## Vamos ignorar a node_modules por isso criaremos um .dockerignore
COPY . .
## Container ficará ouvindo os acessos na porta 3000
EXPOSE 3000/tcp
## Não se repete no Dockerfile
## Executa o comando npm start para iniciar o script que que está no package.json
CMD npm start