From 48b2e8fc9f139aad542ddfe350beb7251e3df9f5 Mon Sep 17 00:00:00 2001 From: Willem Remie Date: Fri, 22 May 2020 23:10:19 +0200 Subject: [PATCH 1/4] add Dockerfile for apache webserver including php --- web/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 web/Dockerfile diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 0000000..5be11e0 --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,3 @@ +FROM php:apache + +RUN docker-php-ext-install mysqli \ No newline at end of file From 365a9b79d170ebff1ffabc8731aaf40ca590be44 Mon Sep 17 00:00:00 2001 From: Willem Remie Date: Fri, 22 May 2020 23:11:39 +0200 Subject: [PATCH 2/4] add docker-compose spinning up mysql, phpmyadmin, and apache webserver including php --- docker-compose.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..1c47d26 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,35 @@ +version: '3' + +services: + + # database + database: + image: mysql:latest + restart: always + volumes: + - ./database/trials.sql:/docker-entrypoint-initdb.d/trials.sql + environment: + MYSQL_DATABASE: facemaker + MYSQL_ALLOW_EMPTY_PASSWORD: 'true' + + # phpmyadmin + phpmyadmin: + depends_on: + - database + image: phpmyadmin/phpmyadmin:latest + restart: always + ports: + - '8000:80' + environment: + PMA_HOST: database + + # webserver + web: + depends_on: + - database + build: ./web + restart: always + ports: + - '8080:80' + volumes: + - ./web:/var/www/html/ \ No newline at end of file From 17bde4e6afee93c5de342cfb38d73ebb72d7b071 Mon Sep 17 00:00:00 2001 From: Willem Remie Date: Fri, 22 May 2020 23:12:45 +0200 Subject: [PATCH 3/4] php/config.php: add mysql server parameters --- web/php/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/php/config.php b/web/php/config.php index 667648f..9c3d4bf 100644 --- a/web/php/config.php +++ b/web/php/config.php @@ -7,7 +7,7 @@ or die ("Connection could be established"); //echo "choosing local db

"; } else { - $connection = mysqli_connect("HOSTNAME", "USERNAME", "PASSWORD", "DATABASENAME") + $connection = mysqli_connect("database", "root", "", "facemaker") or die ("Connection could be established"); //echo "choosing online db

"; } From 63a64771516dc87c543e8e2147e6508ae189bec3 Mon Sep 17 00:00:00 2001 From: Willem Remie Date: Fri, 22 May 2020 23:13:49 +0200 Subject: [PATCH 4/4] patch: change appVersion and timeDate type to TEXT --- database/trials.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/trials.sql b/database/trials.sql index c304904..f3fb37b 100644 --- a/database/trials.sql +++ b/database/trials.sql @@ -49,11 +49,11 @@ CREATE TABLE IF NOT EXISTS `trials` ( `cookies` varchar(5) DEFAULT NULL, `platform` varchar(30) NOT NULL, `appCodeName` varchar(30) NOT NULL, - `appVersion` varchar(15) DEFAULT NULL, + `appVersion` text DEFAULT NULL, `product` varchar(30) NOT NULL, `browser` varchar(20) DEFAULT NULL, `webgl` varchar(4) DEFAULT NULL, - `timeDate` varchar(40) NOT NULL, + `timeDate` text NOT NULL, `timeWelcome` bigint(20) DEFAULT NULL, `timeStart` bigint(20) DEFAULT NULL, `timeEnd` bigint(20) DEFAULT NULL,