aboutsummaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/docker-compose.yml20
-rw-r--r--docker/lamp-php7.Dockerfile3
-rwxr-xr-xdocker/readme-lamp.sh (renamed from docker/readme-php5.sh)16
3 files changed, 31 insertions, 8 deletions
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 9a7aa44..dcc4ed1 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -1,9 +1,7 @@
-# Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5
-# WARNING: Not suitable for production environments, only for testing legacy php5 application.
-# (Docker image supplementary files licenced under Apache 2.0)
-
-version: "3"
services:
+ # Image for LAMP based on Dockerfile in https://github.com/jakejarvis/docker-lamp-php5
+ # WARNING: Not suitable for production environments, only for testing legacy php5 application.
+ # (Docker image supplementary files licenced under Apache 2.0)
lamp-php5:
image: docker.io/jakejarvis/lamp-php5:latest
ports:
@@ -12,3 +10,15 @@ services:
volumes:
- "../h-source:/app"
- "../mysql:/var/lib/mysql"
+ # Image for LAMP based on https://github.com/mattrayner/docker-lamp
+ # (Docker image licenced under Apache 2.0)
+ lamp-php7:
+ build:
+ dockerfile: lamp-php7.Dockerfile
+ context: .
+ ports:
+ - 8001:80
+ - 3306:3306
+ volumes:
+ - "../h-source:/app"
+ - "../mysql:/var/lib/mysql"
diff --git a/docker/lamp-php7.Dockerfile b/docker/lamp-php7.Dockerfile
new file mode 100644
index 0000000..4dc7b50
--- /dev/null
+++ b/docker/lamp-php7.Dockerfile
@@ -0,0 +1,3 @@
+FROM mattrayner/lamp:latest-1804
+
+CMD ["/run.sh"] \ No newline at end of file
diff --git a/docker/readme-php5.sh b/docker/readme-lamp.sh
index 7ec58b1..c73cbfa 100755
--- a/docker/readme-php5.sh
+++ b/docker/readme-lamp.sh
@@ -1,6 +1,13 @@
#!/bin/bash
#
-# INSTRUCTIONS for testing with docker-lamp-php5:
+# Spin up a docker lamp image.
+#
+# Usage:
+# ./readme-lamp.sh [php-version]
+#
+# php-version: 5 or 7 (default)
+#
+# INSTRUCTIONS for testing with docker-lamp-php{5,7}:
#
# After the docker container spins up,
# the mysql password will be displayed.
@@ -12,5 +19,8 @@
# and populate the schema/initial data with:
# mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql
-docker-compose up --build lamp-php5
-
+if [ -z "$1"]; then
+ docker-compose up --build lamp-php7
+else
+ docker-compose up --build lamp-php"$1"
+fi