This repository contains examples of how to use Docker to run applications in a production environment. The examples include a variety of languages and frameworks, and are designed to showcase best practices for deploying and managing Docker containers.
To get started with using Docker for your own applications, follow these steps:
- Install Docker on your local machine or server.
- Clone this repository to your local machine using
git clone https://github.com/anuj-sadani-infrrd/docker_the_right_way.git - Navigate to the folder containing the example you wish to run.
- Follow the instructions in the example's README file to build and run the Docker container.
This repository includes examples for Python, however it can be applied to other programming languages and frameworks:
- Python/Flask (SpaCY model)
Each example includes a README file with detailed instructions on how to build and run the Docker container. Follow the step by step guide in the README
- Basic app
- Add some tests
- The first container
- Order Dockerfile Commands Appropriately
- Use explicit and deterministic Docker base image
- Minimize the Number of Layers
- Use multi stage build
- Add only required stuffs (use .dockerignore)
- Do not run container with root privilege
If you would like to contribute to this repository, feel free to submit a pull request with your changes. We welcome contributions that improve the quality and usability of the examples.
This repository is licensed under the MIT License. Feel free to use and modify the code as needed.