refactor: restructure registry with auth and agent guidelines

- Add built-in authentication with Apache utils
- Add AGENTS.md for coding guidelines
- Enhance security with authentication enabled by default
- Remove unnecessary template files
- Simplify configuration and setup process
This commit is contained in:
2025-11-05 04:11:21 -08:00
parent f4611b4d23
commit d8bfde5796
9 changed files with 106 additions and 187 deletions

36
AGENTS.md Normal file
View File

@@ -0,0 +1,36 @@
# Agent Guidelines for Docker Registry Project
## Build & Run
```bash
# Build and start services
docker-compose up -d --build
# Rebuild single service
docker-compose up -d --build registry
```
## Code Style
- YAML files: 2 space indentation
- Shell scripts: Follow [Google Shell Style Guide](https://google.github.io/styleguide/shellguide.html)
- Docker best practices:
- Use multi-stage builds when possible
- Minimize layer size and number
- Pin base image versions
- Place volatile commands last
- One service per container
## Error Handling
- Shell scripts: Use set -e for strict error handling
- Log errors to stdout/stderr for Docker logging
- Follow the fail-fast principle
- Include error context in messages
## File Structure
```
.
├── config.yml # Registry configuration
├── docker-compose.yml # Service orchestration
├── Dockerfile # Registry image build
├── entrypoint.sh # Container initialization
└── setup.sh # Local environment setup
```