diff --git a/Dockerfile b/Dockerfile index 7eb19d5..3678c37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ -FROM php:7-apache -MAINTAINER Tool Tooling +FROM php:7.2.32-apache-buster +#MAINTAINER Tool Tooling RUN docker-php-ext-install mysqli COPY apache-config.conf /etc/apache2/sites-available/000-default.conf COPY start-apache /usr/local/bin -RUN a2enmod rewrite +RUN chmod +x /usr/local/bin/start-apache && a2enmod rewrite # Copy application source COPY html /var/www RUN chown -R www-data:www-data /var/www +EXPOSE 80 + CMD ["start-apache"] diff --git a/README.md b/README.md index 023f239..4378a8d 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This repository hosts the code for the StegTechHub tooling website. The website ## Technologies Used -The project leverages the following technologies: +The project leverages the following technologies:.. - **Backend:** - PHP 8.3 @@ -28,3 +28,6 @@ The project leverages the following technologies: | Docker Tag | GitHub Release | Nginx Version | PHP Version | Ubuntu Version | |-----|-------|-----|--------|--------| | latest | master Branch |1.17.2 | 8.3 | Latest | + +.... +adding a new line for test publish again diff --git a/html/functions.php b/html/functions.php index 5928405..3e60659 100644 --- a/html/functions.php +++ b/html/functions.php @@ -2,16 +2,16 @@ session_start(); // connect to database -$db = mysqli_connect('127.0.0.1', 'admin', 'admin', 'tooling'); +$db = mysqli_connect('mysql-server2', 'Willie', 'Password123', 'tooling'); // Check connection -// if (mysqli_connect_errno()) { -// echo "Failed to connect to MySQL: " . mysqli_connect_error(); -// exit(); -// } -// else{ -// echo "connected"; -// } +if (mysqli_connect_errno()) { +echo "Failed to connect to MySQL: " . mysqli_connect_error(); +exit(); +} +else{ +echo "connected"; +} // variable declaration $username = ""; diff --git a/tooling.yml b/tooling.yml new file mode 100644 index 0000000..3d5f82d --- /dev/null +++ b/tooling.yml @@ -0,0 +1,33 @@ +version: "3.9" +services: + tooling_frontend: + build: . + ports: + - "5001:80" + volumes: + - tooling_frontend:/var/www/html + links: + - db + networks: + - dbnet + + db: + image: mysql:5.7 + restart: always + container_name: mysql-server2 + environment: + MYSQL_DATABASE: tooling + MYSQL_USER: Willie + MYSQL_PASSWORD: Password123 + MYSQL_RANDOM_ROOT_PASSWORD: Password123 + volumes: + - db:/var/lib/mysql + networks: + - dbnet +volumes: + tooling_frontend: + db: + +networks: + dbnet: + driver: bridge \ No newline at end of file