31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
---
|
|
description:
|
|
globs:
|
|
alwaysApply: false
|
|
---
|
|
# Dockerfiles
|
|
|
|
This project uses a multi-stage Dockerfile approach for different environments.
|
|
|
|
## Development Dockerfile
|
|
[docker/template/Dockerfile](mdc:docker/template/Dockerfile): Used for local development
|
|
- Optimized for fast rebuilds and development workflow
|
|
- Includes development tools and debugging capabilities
|
|
- Used by [docker-compose.dev.yml](mdc:docker-compose.dev.yml)
|
|
- Allows for volume mounting of source code
|
|
|
|
## Production Dockerfile
|
|
[docker/template/Dockerfile.production](mdc:docker/template/Dockerfile.production): Used for production deployments
|
|
- Optimized for security, size, and performance
|
|
- Removes development dependencies and tools
|
|
- Used by [docker-compose.production.yml](mdc:docker-compose.production.yml)
|
|
- Bakes the source code into the image
|
|
|
|
## Guidelines
|
|
- Keep base images consistent between environments
|
|
- Use multi-stage builds to optimize image size
|
|
- Pin specific versions of base images
|
|
- Include proper healthchecks
|
|
- Document any environment variables required
|
|
- Optimize caching by ordering instructions appropriately (dependencies first, code last)
|