From 7b2c76f23be47a8753cfe6d197843a82c6ebf26d Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 26 Aug 2021 11:24:58 +1000 Subject: Moving docker files to its own directory. Also applied the docker patch and removed some commented code. --- docker/docker-compose.yml | 14 ++++++++++++++ docker/readme-php5.sh | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 docker/docker-compose.yml create mode 100755 docker/readme-php5.sh (limited to 'docker') diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..c3f2349 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,14 @@ +# 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: + lamp-php5: + image: docker.io/jakejarvis/lamp-php5:latest + ports: + - 80:80 + - 3306:3306 + volumes: + - "../h-source:/app" + - "./mysql:/var/lib/mysql" diff --git a/docker/readme-php5.sh b/docker/readme-php5.sh new file mode 100755 index 0000000..fb62a4d --- /dev/null +++ b/docker/readme-php5.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# INSTRUCTIONS for testing with docker-lamp-php5: +# +# After the docker container spins up, +# the mysql password will be displayed. +# - MySQL on port 3306 +# - Apache on port 80 +# +# Don't forget to create the database: +# mysql -uadmin -pXXX -h127.0.0.1 +# > create database hnode; +# > ^D +# 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 + -- cgit v1.2.3 From cf8584c645ca1178c027268b9fd273db6d15248a Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 26 Aug 2021 11:44:01 +1000 Subject: change mysql dir --- docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docker') diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c3f2349..9a7aa44 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -11,4 +11,4 @@ services: - 3306:3306 volumes: - "../h-source:/app" - - "./mysql:/var/lib/mysql" + - "../mysql:/var/lib/mysql" -- cgit v1.2.3 From 6995bcca056862e52d1167d6ee7e67d73a2bdd95 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 26 Aug 2021 11:56:07 +1000 Subject: updating the database creation command to be more "batchy" --- docker/readme-php5.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'docker') diff --git a/docker/readme-php5.sh b/docker/readme-php5.sh index fb62a4d..7ec58b1 100755 --- a/docker/readme-php5.sh +++ b/docker/readme-php5.sh @@ -8,9 +8,7 @@ # - Apache on port 80 # # Don't forget to create the database: -# mysql -uadmin -pXXX -h127.0.0.1 -# > create database hnode; -# > ^D +# mysql -uadmin -pXXX -h127.0.0.1 -e "create database hnode;" # and populate the schema/initial data with: # mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql -- cgit v1.2.3 From 06934eb28d86775cf1472c9a83cfce80e71597d8 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 6 Sep 2021 10:27:36 +1000 Subject: Adding lamp-php7 docker command. - Tested locally. The website up and running. - Also updated the readme script to run either php5 or php7. --- docker/docker-compose.yml | 19 +++++++++++++++---- docker/lamp-php7.Dockerfile | 3 +++ docker/readme-lamp.sh | 26 ++++++++++++++++++++++++++ docker/readme-php5.sh | 16 ---------------- 4 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 docker/lamp-php7.Dockerfile create mode 100755 docker/readme-lamp.sh delete mode 100755 docker/readme-php5.sh (limited to 'docker') diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 9a7aa44..35e4623 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,9 +1,8 @@ -# 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 +11,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: + - 80: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-lamp.sh b/docker/readme-lamp.sh new file mode 100755 index 0000000..d5aa572 --- /dev/null +++ b/docker/readme-lamp.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# 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. +# - MySQL on port 3306 +# - Apache on port 80 +# +# Don't forget to create the database: +# mysql -uadmin -pXXX -h127.0.0.1 -e "create database hnode;" +# and populate the schema/initial data with: +# mysql -uadmin -pXXX -h127.0.0.1 hnode < ../h-source/tables.sql + +if [ -z "$1" ]; then + docker-compose up --build lamp-php7 +else + docker-compose up --build lamp-php"$1" +fi diff --git a/docker/readme-php5.sh b/docker/readme-php5.sh deleted file mode 100755 index 7ec58b1..0000000 --- a/docker/readme-php5.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# -# INSTRUCTIONS for testing with docker-lamp-php5: -# -# After the docker container spins up, -# the mysql password will be displayed. -# - MySQL on port 3306 -# - Apache on port 80 -# -# Don't forget to create the database: -# mysql -uadmin -pXXX -h127.0.0.1 -e "create database hnode;" -# 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 - -- cgit v1.2.3 From 737f4cd5e986024ab953ff81d8f8d54d33e22bf4 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 9 Sep 2021 10:28:58 +1000 Subject: simplifying the docker-compose for php7. tested locally. --- docker/docker-compose.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'docker') diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 35e4623..544ac17 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -14,9 +14,7 @@ services: # 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: . + image: mattrayner/lamp:latest-1804 ports: - 80:80 - 3306:3306 -- cgit v1.2.3 From e98b991a5870b8af01b6987118efd4f3ee60834d Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 9 Sep 2021 11:42:53 +1000 Subject: remove redundant dockerfile --- docker/lamp-php7.Dockerfile | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 docker/lamp-php7.Dockerfile (limited to 'docker') diff --git a/docker/lamp-php7.Dockerfile b/docker/lamp-php7.Dockerfile deleted file mode 100644 index 4dc7b50..0000000 --- a/docker/lamp-php7.Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM mattrayner/lamp:latest-1804 - -CMD ["/run.sh"] \ No newline at end of file -- cgit v1.2.3