Server rental store

.dockerignore file

# The .dockerignore File: Optimizing Your MediaWiki Docker Builds

This article explains the purpose and usage of the `.dockerignore` file when building Docker images for your MediaWiki installation. Properly configuring this file is crucial for efficient build times and smaller image sizes, ultimately improving the performance and maintainability of your MediaWiki server. This guide is aimed at newcomers to Docker and MediaWiki server administration.

== What is the .dockerignore File?

The `.dockerignore` file functions similarly to a `.gitignore` file used in Git version control. It tells the Docker build process which files and directories to exclude from the build context. The build context is the set of files that are sent to the Docker daemon to build the image. Including unnecessary files in the build context can significantly increase build times and the final image size.

By strategically excluding files like temporary build artifacts, local development tools, and sensitive information, you can streamline the build process and create a more secure and efficient MediaWiki Docker image. Without a `.dockerignore` file, *everything* in the directory where you run `docker build` is sent to the daemon.

== Why is .dockerignore Important for MediaWiki?

MediaWiki installations often include a significant number of files that are not required within the production Docker image. These can include:

⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️