My first thought was to make an exception and add the database file to Git.
However, my follow-up thought was that that was a mistake.
To put this into greater context, the application is, effectively, a test harness for a PHP library that I’ve been developing for a client.
Given that, when initially deployed, the database’s tables should always be empty.
So, if the database was tracked by Git, the likelihood of random records being added over time would be introduced.
Therefore, having random database records may lead to myself or someone else, in the future, to think that the application doesn’t work as expected.
So, how could the SQLite database be available in the Docker image, yet not tracked by Git?
There are only two tables in the database, and they’re not all that sophisticated.
So that was one less thing to think about.
I thought about using a migrations tool, such as Doctrine Migrations or Laravel Migrations, in the image’s Dockerfile.
However, while they’re excellent tools, they seemed like overkill.
So, again, how could the database be provisioned when the applicable Docker image was built?
Good question…
Join the discussion
comments powered by Disqus