最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

automation - Optimizing a containerized database initialization and startup - Stack Overflow

programmeradmin1浏览0评论

I have a small Docker container running a static (read-only) database which contains data for drop-down menus and web ui content such as counties per state, zip codes, etc.

The image is generated whenever the database content is changed via a commit pipeline. Currently, the database tables are populated when the container first starts using SQL scripts I created in docker-entrypoint-initdb.

So far, this is working well. However, there is a container startup cost associated with running the initdb scripts and I am considering starting the container as part of the pipeline and then creating an image from the container once the database tables are populated.

Is this a container anti-pattern? It feels a little unnatural from a pipeline/container perspective but it would allow containers to spin up faster.

I strongly prefer not to use a volume for this application as it really isn’t needed and it adds complexity to the deployed application.

发布评论

评论列表(0)

  1. 暂无评论