Docker containers
- Approach
- The
Dockerfileand application configuration MUST use a production-by-default approach - The required healthcheck endpoints MUST be added
- Development dependencies such as Pytest or Webpack MUST NOT appear in your production image (production by default)
- An application SHOULD use a single
Dockerfile(having a separateDockerfilefor local development introduces potential differences between local and deployed applications) - Configuration for lower environments (e.g. staging/dev) SHOULD extend and overwrite production values
- The base Python images SHOULD be used to build your application
- Setting environment variables during local development SHOULD be done in
docker-compose.ymlas it is not used outside of local development - The TNA application templates COULD be used to start building your application
- The
- Source control
- You SHOULD use a single working branch;
mainand build production-ready images with every push to it - You COULD build all images for pushes to any working/feature branch (allowing you to deploy an image for any feature branch)
- You COULD remove all images created from working/feature branches after you merge to
main
- You SHOULD use a single working branch;
Healthcheck endpoints
Your container MUST expose at least one healthcheck endpoint.
Any implimented healthcheck endpoints MUST respond with a 200 HTTP status.
| Route | Expected content |
|---|---|
/healthcheck/ (optional) |
Any truthy value (e.g. ok, okay or up) |
/healthcheck/live/ |
Any truthy value (e.g. ok, okay or up) |
/healthcheck/version/ (optional) |
Application version (e.g. 26.04.14.12345) |