Author: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
all: fix db issues inside the container
config/database.php | 4 +++- docker-compose.yml | 5 +----
diff --git a/config/database.php b/config/database.php index c4485df86155ee9b5e1e88dd9fb8fd4eefae791a..cc3ee824f36ab41769884089fbe25f424efc11ae 100644 --- a/config/database.php +++ b/config/database.php @@ -1,7 +1,9 @@ <?php function getDatabaseConnection() { - $pdo = new PDO('sqlite:storage/database.sqlite'); + $dbFile = __DIR__ . '/../storage/database.sqlite'; + + $pdo = new PDO('sqlite:' . $dbFile); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return $pdo; diff --git a/docker-compose.yml b/docker-compose.yml index d2c11d147f646bc0c4b093915d16b504bff36363..2f80507fa77163eeb54c790f7adeec9e6cf9ff6c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,9 +8,6 @@ ports: - "8000:8000" volumes: - .:/var/www - - sqlite-data:/var/www/storage + - ./storage:/var/www/storage command: > sh -c "php -S 0.0.0.0:8000 -t public" - -volumes: - sqlite-data: