77 lines
1.8 KiB
Markdown
77 lines
1.8 KiB
Markdown
# Dom
|
|
|
|
A notification scheduling system with Docker support.
|
|
|
|
## Quick Start with Docker Compose
|
|
|
|
1. **Build and start the service:**
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
2. **View logs:**
|
|
```bash
|
|
docker-compose logs -f
|
|
```
|
|
|
|
3. **Stop the service:**
|
|
```bash
|
|
docker-compose down
|
|
```
|
|
|
|
## Configuration
|
|
|
|
The configuration file is located in the `config/` directory and is mapped as a volume, allowing you to modify it without rebuilding the container.
|
|
|
|
### Modifying Configuration
|
|
|
|
1. Edit `config/config.json` on your host machine
|
|
2. The changes will be automatically picked up by the container
|
|
3. Restart the container if needed: `docker-compose restart`
|
|
|
|
### Configuration Options
|
|
|
|
- `ollama_endpoint`: Ollama API endpoint
|
|
- `ollama_model`: Model to use for text generation
|
|
- `silent_start`: Start time for silent period (HH:MM)
|
|
- `silent_end`: End time for silent period (HH:MM)
|
|
- `timezone`: Timezone for scheduling
|
|
- `min_interval`: Minimum interval between notifications (minutes)
|
|
- `max_interval`: Maximum interval between notifications (minutes)
|
|
- `bark_api_url`: Bark notification service URL
|
|
- `bark_device_key`: Bark device key
|
|
- `ntfy_api_url`: Ntfy notification service URL
|
|
- `ntfy_topic`: Ntfy topic
|
|
- `ntfy_access_token`: Ntfy access token
|
|
- `templates_dir`: Directory containing notification templates
|
|
|
|
## Development
|
|
|
|
### Local Development
|
|
```bash
|
|
python3 main.py
|
|
```
|
|
|
|
### Building Docker Image
|
|
```bash
|
|
docker build -t dom .
|
|
```
|
|
|
|
### Running with Docker
|
|
```bash
|
|
docker run -d \
|
|
--name dom \
|
|
-v $(pwd)/config:/app/config \
|
|
-v $(pwd)/templates:/app/templates \
|
|
dom
|
|
```
|
|
|
|
## Volumes
|
|
|
|
- `./config:/app/config`: Configuration directory (read-write)
|
|
- `./templates:/app/templates`: Templates directory (read-only)
|
|
|
|
## Environment Variables
|
|
|
|
- `TZ`: Timezone (default: Asia/Shanghai)
|