DEV Community

Discussion on: Quick Web Server with Nginx on Docker Compose

Collapse
 
fab23 profile image
fab

Then you can add a simple healthcheck and everything will be monitored forever :)

version: "3"

services:
    client:
        image: nginx
        ports:
            - 8000:80
        volumes:
            - ./src:/usr/share/nginx/html

    healthcheck:
        test: curl --fail http://localhost || exit 1
        interval: 60s
        retries: 5
        start_period: 20s
        timeout: 10s
Enter fullscreen mode Exit fullscreen mode