This project provides a local development infrastructure with automatic DNS resolution for custom domains (e.g., `.mikan` or `.local`) and valid HTTPS certificates.
## Features
- Automatic DNS resolution for `*.yourdomain` and `*.yourdomain.local`
- Valid HTTPS certificates for local domains using `mkcert`
- Easy service deployment with `VIRTUAL_HOST` environment variables
- Ready for future expansion: public domains, Let's Encrypt, Tailscale
- Single-command service creation
## Requirements
- Docker and Docker Compose
-`mkcert` installed on the host system
## Quick Start
1. Clone this repository and enter the directory:
```bash
git clone <repository-url> local-dns
cd local-dns
```
2. Initialize the project:
```bash
./scripts/00-init.sh
```
This creates a `.env` file from `.env.example` and sets up the directory structure.
3. Generate TLS certificates:
```bash
./scripts/01-generate-cert.sh
```
This creates trusted certificates for your local domain.
4. Start the core infrastructure:
```bash
docker compose up -d
```
5. Add your first service (example: Gitea on port 3000):
```bash
./scripts/add-service.sh gitea 3000
```
Then edit `services/gitea/docker-compose.yml` to set the correct image and volumes.
6. Start the new service:
```bash
docker compose -f docker-compose.yml -f services/gitea/docker-compose.yml up -d
```
7. Visit `https://gitea.yourdomain` in your browser (replace `yourdomain` with your configured domain).
## Configuration
Edit the `.env` file to customize your setup:
-`LOCAL_DOMAIN`: Your local domain suffix (default: `mikan`)
-`PUBLIC_DOMAIN`: Optional public domain for Let's Encrypt certificates
-`LETSENCRYPT_EMAIL`: Email for Let's Encrypt notifications