Skip to content

Instantly share code, notes, and snippets.

@pamtrak06
Created May 14, 2020 14:34
Show Gist options
  • Select an option

  • Save pamtrak06/2c67875682cc5806359619fdd5b977a4 to your computer and use it in GitHub Desktop.

Select an option

Save pamtrak06/2c67875682cc5806359619fdd5b977a4 to your computer and use it in GitHub Desktop.

Revisions

  1. pamtrak06 renamed this gist May 14, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. pamtrak06 created this gist May 14, 2020.
    80 changes: 80 additions & 0 deletions swarmpit.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,80 @@
    version: '3.3'

    services:
    app:
    image: swarmpit/swarmpit:latest
    environment:
    - SWARMPIT_DB=http://db:5984
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
    - 888:8080
    networks:
    - net
    - traefik-public
    deploy:
    resources:
    limits:
    cpus: '0.50'
    memory: 1024M
    reservations:
    cpus: '0.25'
    memory: 512M
    placement:
    constraints:
    - node.role == manager
    labels:
    - traefik.frontend.rule=Host:${DOMAIN?Variable DOMAIN not set}
    - traefik.enable=true
    - traefik.port=8080
    - traefik.tags=traefik-public
    - traefik.docker.network=traefik-public
    - traefik.frontend.entryPoints=http,https
    - traefik.frontend.redirect.entryPoint=https

    db:
    image: couchdb:2.3.0
    volumes:
    - db-data:/opt/couchdb/data
    networks:
    - net
    deploy:
    resources:
    limits:
    cpus: '0.30'
    memory: 512M
    reservations:
    cpus: '0.15'
    memory: 256M
    placement:
    constraints:
    - node.labels.swarmpit.db-data == true

    agent:
    image: swarmpit/agent:latest
    environment:
    - DOCKER_API_VERSION=1.35
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
    - net
    deploy:
    mode: global
    resources:
    limits:
    cpus: '0.10'
    memory: 64M
    reservations:
    cpus: '0.05'
    memory: 32M

    networks:
    net:
    driver: overlay
    attachable: true
    traefik-public:
    external: true

    volumes:
    db-data:
    driver: local