Skip to content

Commit 1f61c50

Browse files
committed
Bind mount ./sail-mysql and ignore it
Switch MySQL service volume from the named volume 'sail-mysql' to a host bind mount './sail-mysql' in docker-compose.yml so DB files are stored in the project directory. Add /sail-mysql to .gitignore to avoid committing the database files.
1 parent d789313 commit 1f61c50

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/public/tmp
77
/storage/*.key
88
/vendor
9+
/sail-mysql
910
.env
1011
.env.backup
1112
.phpunit.result.cache

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
MYSQL_PASSWORD: '${DB_PASSWORD}'
4545
MYSQL_ALLOW_EMPTY_PASSWORD: 1
4646
volumes:
47-
- 'sail-mysql:/var/lib/mysql'
47+
- './sail-mysql:/var/lib/mysql'
4848
- './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
4949
networks:
5050
- sail

0 commit comments

Comments
 (0)