Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To demonstrate HPA, we will use a custom docker image based on the php-apache image. Launch the docker build command, after copying the contents of  Copy the following lines of code into the Dockerfile and the index.php files and place them in the same folder. Then run the docker build . command

Code Block
languagephp
titleDockerfile and index.php
collapsetrue
FROM php:5-apache
COPY index.php /var/www/html/index.php
RUN chmod a+rx index.php

// These lines of code define the index.php file, which performs some CPU intensive computations
<?php
  $x = 0.0001;
  for ($i = 0; $i <= 1000000; $i++) {
    $x += sqrt($x);
  }
  echo "OK!";
?>

...