.dockerignore

Since Docker copies all files from the building folder, we have to add the .dockerignore file that contains the patterns of paths to avoid copying these files. It's useful, for example, to skip the target building folder, because it may contain gigabytes of data for large projects, but in any case, we don't need all of them since we'll build a microservice using the image with the Rust compiler. Add the .dockerignore file:

target
Cargo.lock
**/*.rs.bk
files
*.db

We will ignore all Rust's build artifacts (such as the target, Cargo.lock, and *.bk files that are produced by the rustfmt tool that we will use later) in the next chapter, where we will explore continuous integration tools. We also included two patterns: files—this folder will be created by this microservice to store files if you try to run it locally, and *.db—not a necessary pattern for SQLite Database, because this version uses PostgreSQL instead of SQLite, but useful if you want to support both databases for testing reasons later.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.37.196