version: '3'

services:
  web:
    image: vipercloud/web:latest
    deploy:
      resources:
        limits:
          cpus: '0.5'
          memory: 200M
      replicas: 2
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
      labels:
        - traefik.port=5000
        - traefik.backend=vipercloud-web
        - traefik.frontend.rule=Host:www.viper.cloud,viper.cloud
        - traefik.backend.loadbalancer.sticky=true
        - traefik.docker.network=core_ingress
    networks:
      - ingress 
      - private

  db:
    image: mongo:3.4
    deploy:
      resources:
        limits:
          cpus: '1.0'
          memory: 500M
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
    networks:
      - private

networks:
  private:
    driver: overlay
  ingress:
    external:
      name: core_ingress

version: '3'

services:
  web:
    image: vipercloud/web:latest
    deploy:
      resources:
        limits:
          cpus: '0.5'
          memory: 200M
      replicas: 2
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
      labels:
        - traefik.port=5000
        - traefik.backend=vipercloud-web
        - traefik.frontend.rule=Host:www.viper.cloud,viper.cloud
        - traefik.backend.loadbalancer.sticky=true
        - traefik.docker.network=core_ingress
    networks:
      - ingress 
      - private

  db:
    image: mongo:3.4
    deploy:
      resources:
        limits:
          cpus: '1.0'
          memory: 500M
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
        window: 120s
    volumes:
      - /var/db/vipercloud:/data/db
    networks:
      - private

networks:
  private:
    driver: overlay
  ingress:
    external:
      name: core_ingress

Write viper.cloud data outsie of container
Write viper.cloud data outsie of container
