Commit 0b56f52
committed
refactor: Utilize multistage builds to improve caching and compatibility
The main changes here are;
* using multi-stage builds for better caching and smaller images
* explicitly listing the files that should be included / "COPY"able into the containers
For the API, I moved the tests outside the `src` folder.
That way, we do not include the tests in the finished image.
Since we use multi-stage builds, we can install the necessary compilers for running on ARM.
The compilers are not part of the "production" image, and we don't need to worry about them taking up more space in the image layers.
I also created a user (similar to what's done in `nginx`) so that we can run the tests without running the container as root.
When only installing the necessary packages, I noticed that `click` is not explicitly defined, so it wasn't included in `site-packages`.
By explicitly listing it in `pyproject.toml`, that issue is resolved.1 parent df215da commit 0b56f52
File tree
38 files changed
+227
-115
lines changed- api
- src
- tests
- integration
- common
- features
- health_check
- todo
- whoami
- unit
- common
- data_providers/clients/mongodb
- features
- todo
- entities
- repository
- use_cases
- documentation/docs/contribute/development-guide
- coding/extending-the-api
- adding-data-providers
- adding-features
- web
38 files changed
+227
-115
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
2 | 15 | | |
3 | 16 | | |
4 | 17 | | |
5 | 18 | | |
6 | 19 | | |
7 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
8 | 31 | | |
9 | | - | |
10 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
11 | 42 | | |
12 | 43 | | |
13 | | - | |
14 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
15 | 65 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
20 | 70 | | |
21 | 71 | | |
22 | 72 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
26 | 76 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
103 | | - | |
104 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | | - | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
0 commit comments