Closed PraveenMDevOps closed 11 months ago
It was the version compatibility issue with the applications.
Used the below docker-stack.yml file and the application is working fine
version: "3"
services:
redis:
image: redis:latest
networks:
- frontend
deploy:
placement:
# Hostname mentioned here is ARM 64bit machine from aws, so the redis service will be deployed in the particular machine
constraints: [node.hostname == ip-172-31-19-141.ap-south-1.compute.internal]
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
db:
image: postgres:alpine3.19
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
networks:
- backend
deploy:
placement:
constraints: [node.role == manager]
vote:
image: dockersamples/examplevotingapp_vote
ports:
- 5000:80
networks:
- frontend
depends_on:
- redis
deploy:
replicas: 2
update_config:
parallelism: 2
restart_policy:
condition: on-failure
result:
image: dockersamples/examplevotingapp_result
ports:
- 5001:80
networks:
- backend
depends_on:
- db
deploy:
replicas: 1
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
worker:
image: dockersamples/examplevotingapp_worker
networks:
- frontend
- backend
depends_on:
- db
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:
# Hostname mentioned here is x86 64bit machine from aws, dockersamples/visualizer:stable will work only in the x86 architeture
constraints: [node.hostname == ip-172-31-7-98.ap-south-1.compute.internal]
networks:
frontend:
backend:
volumes:
db-data:
Description
Docker Swarm | As mentioned in the docker-stack.yml, created all the services in docker swarm. Verified that all the configurations are done without error, but the votingapp_result is not showing the updated result. Refreshed the webpage again and again, but it shows 50% | 50%
Steps to reproduce the issue, if relevant:
Describe the results you received:
Describe the results you expected:
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, Docker for Mac, Docker for Windows, VirtualBox, physical, etc.):