Skip to content

Commit

Permalink
tentando dockerizar
Browse files Browse the repository at this point in the history
  • Loading branch information
LeandroLS committed Nov 1, 2019
1 parent 18bd854 commit 59f3ed4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ services:
MYSQL_DATABASE: teste_habilidade_php
MYSQL_USER: root
MYSQL_PASSWORD: 123456

networks:
- my_net
networks:
my_net:
driver: bridge
Expand Down
4 changes: 2 additions & 2 deletions public/connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
$username = "root";
$password = "123456";
$database = "teste_habilidade_php";
$host = "0.0.0.0";
$host = "localhost";
$driver = "mysql";

try {
$connection = new PDO("{$driver}:dbname={$database};host={$host}:3307", $username, $password);
$connection = new PDO("{$driver}:host={$host}:3307;dbname={$database}", $username, $password);
} catch(Exception $e){
echo "Não foi possível conectar ao banco de dados, verifique as informações de conexão no arquivo " . getcwd() . "/connection.php";
echo "<pre>"; echo $e; echo "</pre>";
Expand Down

0 comments on commit 59f3ed4

Please sign in to comment.