Docker Concepts
What is Docker?
Docker is a platform that help us control the services of our application. Exemple of services: Databases and Email sending.
How does it work?
It creates isoleted enviroments, also know as containers. This containers does not interefeer in the rest of our computer. Conteriners also exposes ports for communication.
Concepts
- Image: Service avaiable via Docker. i.e, techs that whe can store in containers.
- Container: Instance of an image.
- Docker Registry (Docker Hub): Works similar to npm js
- Dockerfile: "Recepet" of an image
Dockerfile example
#Partimos de uma imagem existente
FROM node:10
#Definimos a pasta e copiamos os arquivos
WORKDIR /usr/application
COPY . ./
#Instalamos as dependências
RUN yarn
#Qual porta queremos expor?
EXPOSE 3333
#Executamos nossa aplicação
CMD yarn start
Thank you for your time! I hope you have liked this post!
Source: GoStack Bootcamp from RocketSeat