redis:
  image: quay.io/something/redis:alpine
  ports:
    - "6379"
  deploy:
    replicas: 2
    update_config:
      parallelism: 2
      delay: 10s
    restart_policy:
      condition: on-failure

worker:
  image: "node:10.0.0"

db:
  image: "postgres:9.4.0"
  volumes:
    - db-data:/var/lib/postgresql/data
  deploy:
    placement:
      constraints: [node.role == manager]

vote:
  image: dockersamples/examplevotingapp_vote:before
  ports:
    - 5000:80
  depends_on:
    - redis
  deploy:
    replicas: 2
    update_config:
      parallelism: 2
    restart_policy:
      condition: on-failure

result:
  image: 'dockersamples/examplevotingapp_result:before'
  ports:
    - 5001:80
  depends_on:
    - db
  deploy:
    replicas: 1
    update_config:
      parallelism: 2
      delay: 10s
    restart_policy:
      condition: on-failure

votingworker:
  image: dockersamples/examplevotingapp_worker
  deploy:
    mode: replicated
    replicas: 1
    labels: [APP=VOTING]
    restart_policy:
      condition: on-failure
      delay: 10s
      max_attempts: 3
      window: 120s
    placement:
      constraints: [node.role == manager]

visualizer:
  image: dockersamples/visualizer:stable
  ports:
    - "8080:8080"
  stop_grace_period: 1m30s
  volumes:
    - "/var/run/docker.sock:/var/run/docker.sock"
  deploy:
    placement:
      constraints: [node.role == manager]

edplugins:
  image: ${IMAGE:-synkodevelopers/edplugins}:${TAG:-latest}

debugapp:
  image: app-local-debug
  build:
    context: .
    dockerfile: Dockerfile.local

build-context:
    build: ./debugapp
