Gerenciamento das aplicações
atualizado em 05/03/2018
Interface web de gerenciamento para host Docker
docker run -d \
-p 9000:9000 \
-v "/var/run/docker.sock:/var/run/docker.sock" \
--restart always \
--name portainer portainer/portainer
HTTP reverse proxy and load balancer
Traefik is obviously slower than Nginx, but not so much: Traefik can serve 28392 requests/sec and Nginx 33591 requests/sec which gives a ratio of 85%. Not bad for young project :) !
docker network create --driver=overlay traefik-net
docker service create \
--name traefik \
--constraint=node.role==manager \
--publish mode=host,target=80,published=80 \
--publish 8080:8080 \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--network traefik-net \
traefik \
--logLevel=DEBUG \
--docker \
--docker.swarmmode \
--docker.domain=pmv.local \
--docker.watch \
--web
deploy:
image: prefeituravitoria/docker:latest
script:
- docker login
-u $CI_REGISTRY_USER
-p $CI_REGISTRY_PASSWORD
$CI_REGISTRY
- docker build -t "${CI_REGISTRY_IMAGE}:${TAG_NAME}" .
- docker push "${CI_REGISTRY_IMAGE}:${TAG_NAME}"
- deploy $APP_ID $PORTAINER_ID
version: '3'
services:
web:
image: ${CI_REGISTRY_IMAGE}:${TAG_NAME}
deploy:
labels:
- "traefik.port=80"
- "traefik.docker.network=traefik-net"
- "traefik.frontend.rule=Host:myapplication.pmv.local"
networks:
- traefik-net
networks:
traefik-net:
external: true