Docker can isolate application environments in software containers that are like virtual machines but more lightweight and faster. A Dockerfile defines the steps to build a container image. For example, a Dockerfile can create a container image for a Symfony PHP application that contains PHP-FPM and dependencies. The application code can be mounted into the container from the host machine. Nginx on the host can then serve the application using the container's PHP-FPM.