-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-swarm.yml
57 lines (47 loc) · 1.46 KB
/
docker-swarm.yml
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
## Acessar bash do container
# docker exec -it <container id> /bin/sh
# docker exec -it <container id> /bin/bash
## Logs do container
# docker logs -f --tail 1000 ApiBaileysMd
## Removendo todos os containers e imagens de uma só vez
# docker rm $(docker ps -qa)
## Removendo todas as imagens de uma só vez
# docker rmi $(docker images -aq)
## Removendo imagens
# docker rmi <REPOSITORY>
# docker rmi <IMAGE ID>
## Como obter o endereço IP de um contêiner Docker do host
# https://stack.desenvolvedor.expert/appendix/docker/rede.html
# docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <IMAGE ID>
## Crie a rede overlay
# docker network create --driver=overlay --attachable apiwhatsapp_overlay
# Criar um contêiner
# docker stack deploy -c docker-swarm.yml apiwhatsapp_stack
version: "3.9"
services:
backend:
image: alanmartines/mywhatsapp-api-node-baileys-md:1.0.0
env_file: .env
volumes:
- .:/home/ApiBaileysMd:rw
- ${PATCH_TOKENS:-/usr/local/tokensHomologacao}:/usr/local/tokens:rw
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- ${PORT:-9001}:9001
deploy:
replicas: 2
restart_policy:
condition: on-failure
resources:
limits:
cpus: "0.50"
memory: 1024M
reservations:
cpus: "0.25"
memory: 512M
networks:
- apiwhatsapp_overlay
networks:
apiwhatsapp_overlay:
driver: overlay