Sign inSign up

marcelobrake/healthcheck

By marcelobrake

Updated over 6 years ago

Simple healthcheck

Image
0

6.5K

marcelobrake/healthcheck repository overview

Simple Health Check

Create project

composer create-project --prefer-dist laravel/lumen healthcheck
cd healthcheck

Edit routes/web.php

<?php

$router->get('/', function () use ($router) {
    return ;
});


$router->get('/healthcheck', function () use ($router) {
    $arr = array("health" => true, "timestamp" => time(), "version" => $router->app->version() );
    $out = json_encode($arr);

    return $out;
});

Create Dockerfile

FROM php:7-alpine

WORKDIR /var/www

COPY . /var/www

RUN apk add composer && cd /var/www && composer update

CMD  php -S 0.0.0.0:8080 -t /var/www/public

Tag summary

Content type

Image

Digest

Size

136.4 MB

Last updated

over 6 years ago

docker pull marcelobrake/healthcheck