[add] Configuring the mysql port
This commit is contained in:
parent
403541580d
commit
d2b9163537
@ -34,7 +34,7 @@ $container['mysql'] = function ($c) {
|
|||||||
$databaseConnectionErrorMessage = $mysqlSettings['databaseConnectionErrorMessage'];
|
$databaseConnectionErrorMessage = $mysqlSettings['databaseConnectionErrorMessage'];
|
||||||
|
|
||||||
// Initiate the connection
|
// Initiate the connection
|
||||||
$dsn = "mysql:host=$host;dbname=$database;charset=$charset";
|
$dsn = "mysql:host=$host;port=3307;dbname=$database;charset=$charset";
|
||||||
try {
|
try {
|
||||||
$pdo = new PDO($dsn, $user, $password, $pdoConnectionOptions);
|
$pdo = new PDO($dsn, $user, $password, $pdoConnectionOptions);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@ -69,4 +69,4 @@ $container['employeeApplication'] = function ($c) {
|
|||||||
$employeeApplication = new App\Application\EmployeeApplication($employeeSettings,
|
$employeeApplication = new App\Application\EmployeeApplication($employeeSettings,
|
||||||
$c['mysql'], $c['cryptographyService'], $c['asserts']);
|
$c['mysql'], $c['cryptographyService'], $c['asserts']);
|
||||||
return $employeeApplication;
|
return $employeeApplication;
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
FROM mysql:5.7
|
FROM mysql:5.7
|
||||||
|
|
||||||
|
# Starting scripts
|
||||||
ADD . /docker-entrypoint-initdb.d
|
ADD . /docker-entrypoint-initdb.d
|
||||||
|
|
||||||
|
# Config
|
||||||
|
ADD my.cnf /etc/mysql
|
||||||
|
20
database/my.cnf
Normal file
20
database/my.cnf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; version 2 of the License.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
[mysqld]
|
||||||
|
port = 3307
|
||||||
|
|
||||||
|
!includedir /etc/mysql/conf.d/
|
||||||
|
!includedir /etc/mysql/mysql.conf.d/
|
@ -13,8 +13,10 @@ services:
|
|||||||
container_name: payroll_mysql
|
container_name: payroll_mysql
|
||||||
restart: always
|
restart: always
|
||||||
build: database
|
build: database
|
||||||
|
expose:
|
||||||
|
- "3307"
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3307:3307"
|
||||||
volumes:
|
volumes:
|
||||||
- my-datavolume:/var/lib/mysql
|
- my-datavolume:/var/lib/mysql
|
||||||
environment:
|
environment:
|
||||||
|
Loading…
Reference in New Issue
Block a user