Skip to content
Snippets Groups Projects
Commit 07bd520b authored by Gérôme Canals's avatar Gérôme Canals
Browse files

php/test refactored

parent 2b3f98da
No related branches found
No related tags found
No related merge requests found
###Tests for the 7.2, 7.1 and 5.6 php/apache images
###Tests for the php/apache images
####php7.2 image :
####for php-apache images :
```shell
$ docker-compose -f docker-compose.test.7.2.yml up
Creating web.test.canals.php.7.2
Attaching to web.test.canals.php.7.2
$ ./docker-php-apache.test.sh tag
...
```
should lead to the creation and enaction of a container named _web.test.canals.php.7.2_ .
should lead to the creation and enaction of a docker container based on image canals/php:tag.
Default value for tag is `latest`
To verify that everything goes well, just point your preferred browser to the following urls:
+ http://localhost:27080/
+ http://localhost:27080/index.html
+ http://localhost:27080/info.php
+ https://localhost:27443/
+ https://localhost:27443/index.html
+ https://localhost:27443/info.php
+ http://localhost:9080/
+ http://localhost:9080/index.html
+ http://localhost:9080/info.php
+ https://localhost:9443/
+ https://localhost:9443/index.html
+ https://localhost:9443/info.php
####php7.1 image :
####for php-cli images :
```shell
$ docker-compose -f docker-compose.test.7.1.yml up
Creating web.test.canals.php.7.1
Attaching to web.test.canals.php.7.1
$ ./docker-php-cli.test.sh tag
...
```
should lead to the creation and enaction of a container named _web.test.canals.php.7.1_ .
should lead to the creation and enaction of a docker container based on the image canals/php:tag
The container runs the following command :
```shell
php -S 0.0.0.0:8000
```
To verify that everything goes well, just point your preferred browser to the following urls:
+ http://localhost:25080/
+ http://localhost:25080/index.html
+ http://localhost:25080/info.php
+ https://localhost:25443/
+ https://localhost:25443/index.html
+ https://localhost:25443/info.php
+ http://localhost:8000/
+ http://localhost:8000/fofo
####php5.6 image :
```shell
$ docker-compose -f docker-compose.test.5.6.yml up
Creating web.test.canals.php.5.6
Attaching to web.test.canals.php.5.6
...
```
should lead to the creation and enaction of a container named _web.test.canals.php.5.6_ .
To verify that everything goes well, just point your preferred browser to the following urls:
* http://localhost:26080/
* http://localhost:26080/index.html
* http://localhost:26080/info.php
* https://localhost:26443/
* https://localhost:26443/index.html
* https://localhost:26443/info.php
\ No newline at end of file
version: "3"
services:
web:
image: canals/php:5.6
container_name: web.test.canals.php.5.6
ports:
- "26080:80"
- "26443:443"
volumes :
- ./web:/var/www/html
- ./src:/var/www/src
version: "3"
services:
web:
image: canals/php:7.1
container_name: web.test.canals.php.7.1
ports:
- "25080:80"
- "25443:443"
volumes :
- ./web:/var/www/html
- ./src:/var/www/src
version: "3"
services:
web:
image: canals/php:7.2
container_name: web.test.canals.php.7.2
ports:
- "27080:80"
- "27443:443"
volumes :
- ./web:/var/www/html
- ./src:/var/www/src
version: "3"
services:
php:
image: canals/php:7.3-cli
ports:
- "8800:8000"
volumes:
- ./src:/var/php
working_dir: /var/php
command: php -S 0.0.0.0:8000 index.php
version: "3"
services:
web:
image: canals/php:7.3
container_name: web.test.canals.php.7.3
ports:
- "27080:80"
- "27443:443"
volumes :
- ./web:/var/www/html
- ./src:/var/www/src
#!/usr/local/bin/bash
tag="latest"
if [ $# -ge 1 ]; then
tag=$1
fi
echo "running a canals/php based container with tag : $tag"
docker run --rm\
-p 9080:80 -p 9443:443 \
-v "$PWD"/html:/var/www/html \
-v "$PWD"/src:/var/www/src \
canals/php:$tag
#!/usr/local/bin/bash
if [ $# -lt 1 ]; then
echo "no tag present, stopping"
exit 1
fi
docker run --rm -it \
-p 8000:8000 \
-v "$PWD"/src:/var/php \
-w /var/php \
canals/php:"$1" \
php -S 0.0.0.0:8000
File moved
......@@ -7,7 +7,7 @@
* @author: canals
*/
require_once __DIR__ . '/../src/sample.php';
$sample = require_once __DIR__ . '/../src/sample.php';
echo <<<EOT
<!-- DOCTYPE html-->
......
File moved
......@@ -8,4 +8,4 @@
echo "php is running !". '<br>';
echo "uri : ". $_SERVER['PATH_INFO'] ;
echo "uri : ". ( isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : "/") ;
......@@ -7,4 +7,6 @@
* @author: canals
*/
$sample ='hungry heart';
\ No newline at end of file
$sample ='hungry heart';
return $sample;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment