diff --git a/web/docker-compose.yml b/web/docker-compose.yml index 4984f91..36ed170 100644 --- a/web/docker-compose.yml +++ b/web/docker-compose.yml @@ -5,8 +5,8 @@ services: - inventory-network restart: unless-stopped healthcheck: - test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:3001/api/health"] - interval: 30s + test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/api/health',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))"] + interval: 10s timeout: 3s start_period: 5s retries: 3 @@ -19,7 +19,7 @@ services: - inventory-network depends_on: server: - condition: service_healthy + condition: service_started restart: unless-stopped networks: diff --git a/web/server/Dockerfile b/web/server/Dockerfile index ee1611f..f106652 100644 --- a/web/server/Dockerfile +++ b/web/server/Dockerfile @@ -12,6 +12,6 @@ COPY . . EXPOSE 3001 HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget -qO /dev/null http://localhost:3001/api/health + CMD node -e "require('http').get('http://localhost:3001/api/health',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))" CMD ["node", "server.js"]