mysql integration

This commit is contained in:
Naveenkumar Seetimani Seetimani 2022-10-31 17:06:16 +05:30
parent c13dda1f8b
commit 4828defc52
4 changed files with 1993 additions and 1 deletions

View File

@ -16,3 +16,14 @@ services:
- ./src:/var/www/html
ports:
- 9000:9000
database:
image: mysql:latest
volumes:
- dbvolume:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: todos
volumes:
dbvolume:

View File

@ -1,5 +1,26 @@
FROM php:7.4-fpm
COPY ./www.conf /usr/local/etc/php-fpm.d/
RUN apt-get update
RUN apt-get install -y nano
RUN apt-get install -y iputils-ping
RUN apt-get install -y graphviz aspell clamav
RUN apt-get install -y libxml2-dev
RUN apt-get install -y libzip-dev
RUN apt-get install -y libpng-dev
RUN docker-php-ext-install soap
RUN docker-php-ext-install zip
RUN docker-php-ext-install intl
RUN docker-php-ext-install gd
RUN docker-php-ext-install xmlrpc
RUN docker-php-ext-install mysqli pdo pdo_mysql
RUN docker-php-ext-enable soap
RUN docker-php-ext-enable zip
RUN docker-php-ext-enable intl
RUN docker-php-ext-enable gd
RUN docker-php-ext-enable xmlrpc
RUN docker-php-ext-enable mysqli
RUN docker-php-ext-enable pdo_mysql

1947
phpfpm/php.ini Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,16 @@
<?php
echo phpinfo();
//echo phpinfo();
$servername = "database";
$username = "root";
$password = "secret";
$conn = new mysqli($servername, $username, $password);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
//echo phpinfo();
?>