Commit a61dff2
✨ Improved Dockerfile (#59)
- Combines apt-get layers into one
- Re-orders layers to move most-changed to the end
- Splits out dependencies from source
- Only the app folder needs to be copied
- Only uses pipenv to generate a requirements file - it isn't necessary to create a virtual env on the container
- Adds a .dockerignore with common python artifacts. I'm not seeing any __pycache__ or .pyc files being generated at this time, but it doesn't hurt to have this.
- Parameterizes the host URL at the docker image level, and parameterizes the port + url at the makefile level. E.g. `make docker-run CONTAINER_ADDRESS="something else" CONTAINER_PORT=80`
See [this documentation](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers) for best practices regarding layers and build cache.1 parent e9dabb8 commit a61dff2
3 files changed
+21
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
9 | 16 | | |
10 | | - | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
0 commit comments