Simplify docker usage, HOSTNAME variable is taken from container hostname
All checks were successful
continuous-integration/drone/push Build is passing

Bug: https://github.com/happyDomain/happydeliver/issues/3
This commit is contained in:
nemunaire 2025-11-23 19:41:31 +07:00
commit 016ed7180e
4 changed files with 11 additions and 10 deletions

View file

@ -109,12 +109,13 @@ Default configuration for the Docker environment:
The container accepts these environment variables:
- `DOMAIN`: Email domain for test addresses (default: happydeliver.local)
- `HOSTNAME`: Container hostname (default: mail.happydeliver.local)
- `HAPPYDELIVER_DOMAIN`: Email domain for test addresses (default: happydeliver.local)
Note that the hostname of the container is used to filter the authentication tests results.
Example:
```bash
docker run -e DOMAIN=example.com -e HOSTNAME=mail.example.com ...
docker run -e HAPPYDELIVER_DOMAIN=example.com --hostname mail.example.com ...
```
## Volumes

View file

@ -4,7 +4,7 @@ set -e
echo "Starting happyDeliver container..."
# Get environment variables with defaults
HOSTNAME="${HOSTNAME:-mail.happydeliver.local}"
[ -n "${HOSTNAME}" ] || HOSTNAME=$(hostname)
HAPPYDELIVER_DOMAIN="${HAPPYDELIVER_DOMAIN:-happydeliver.local}"
echo "Hostname: $HOSTNAME"