docker: slim build by excluding .git and non-essential files

Replace the in-Dockerfile `git rev-parse HEAD` with a GIT_HASH build arg
passed from docker-compose (local) or github.sha (CI), defaulting to
"unknown" when unset.

Also exclude .github/, docs/, tests/, and *.md (except www/**/*.md).
This commit is contained in:
j4n
2026-02-17 08:05:57 +01:00
parent c22efeb74b
commit 425e3db07a
4 changed files with 20 additions and 2 deletions

View File

@@ -12,6 +12,8 @@ services:
build:
context: ./
dockerfile: docker/chatmail_relay.dockerfile
args:
GIT_HASH: ${GIT_HASH:-unknown}
image: chatmail-relay:latest
restart: unless-stopped
container_name: chatmail