Use Case : UC17 – Use Containers for Local Development
- Author: Tugba Ilhan
- Date / Version: 11/07/2025 - v0.1
User roles
Role | Description |
---|---|
Developer | Uses containerized environments to build, test, and run the application |
DevOps Team | Provides base container images, ensures compatibility and documentation |
CI/CD System | Optionally runs the same containers in automated pipelines |
Prerequisites / Conditions
-
Docker is installed on the developer’s local machine.
-
Source code is compatible with containerized environments (e.g., PrestaShop, Laravel, etc.).
-
Required Dockerfile and/or docker-compose.yml is available in the repository.
-
Developer has necessary permissions to run and mount local volumes.
Use Case Diagram
Description of use case – Make Payment
-
Developer pulls the latest version of the repository that includes a Dockerfile or docker-compose.yml.
-
Developer runs the container using docker-compose up or docker build + docker run.
-
The container starts with predefined services such as PHP, MariaDB, and Apache/Nginx.
-
Developer mounts their local codebase into the container using volume mounts.
-
As code changes are made locally, they are reflected in the running application.
-
Developer can access the app through a browser (e.g., http://localhost:8080).
-
Logs and errors can be monitored through the Docker CLI or integrated tools.
-
DevOps team may occasionally update base images or documentation.
Exceptions
ID | Description |
---|---|
E1 | Docker is not installed → Provide installation guidance |
E2 | Container build fails due to missing dependency → Update Dockerfile |
E3 | Local code changes are not reflected → Check volume mount syntax |
E4 | Port conflicts (e.g., 80, 3306) → Allow port customization in .env or yml file |
E5 | Application fails to start → Check logs inside container |
Result
Developer can build and test the application inside a container with all dependencies pre-configured, allowing consistent and isolated local development across all team members.
Use frequency
High – used daily by developers during development and testing phases.
Additional information
-
Tools: Docker, Docker Compose, DevContainers (VSCode), Portainer
-
Sample commands:
-
docker-compose up --build
-
docker build -t prestashop-dev . && docker run -v $(pwd):/var/www/html prestashop-dev
-
-
Makefile or script helpers can be added for easier usage
-
Container should replicate staging/production setup as closely as possible
-
Update README.md with usage instructions
Sources