Microservie docker update

This commit is contained in:
2025-10-21 10:10:45 +05:30
parent c40c4fc90f
commit 8e91a4a6a1
4 changed files with 69 additions and 1 deletions

View File

@ -48,6 +48,34 @@ services:
echo '🚀 Starting Gunicorn server...' &&
gunicorn --bind 0.0.0.0:5000 --workers 2 --timeout 120 run:app
"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
microservice:
build:
context: ./Microservice
dockerfile: Dockerfile
container_name: vending-microservice
ports:
- "8088:5001"
volumes:
- ./Microservice:/app
networks:
- vending-network
environment:
- MAIN_BACKEND_URL=https://iotbackend.rootxwire.com
- FLASK_ENV=production
restart: always
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:5001/', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
frontend:
build:
@ -60,6 +88,7 @@ services:
- vending-network
depends_on:
- backend
- microservice
restart: always
networks: