Microservie docker update
This commit is contained in:
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user