feat(output): align container timezone with host
This commit is contained in:
@@ -10,6 +10,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
PUID: "${LOCAL_UID:-1000}"
|
PUID: "${LOCAL_UID:-1000}"
|
||||||
PGID: "${LOCAL_GID:-1000}"
|
PGID: "${LOCAL_GID:-1000}"
|
||||||
|
TZ: "${HOST_TZ:-UTC}"
|
||||||
volumes:
|
volumes:
|
||||||
- ../ForRelease/inbox:/data/inbox
|
- ../ForRelease/inbox:/data/inbox
|
||||||
- ../ForRelease/outbox:/data/outbox
|
- ../ForRelease/outbox:/data/outbox
|
||||||
|
|||||||
@@ -19,10 +19,43 @@ fi
|
|||||||
CALLER_UID=$(id -u)
|
CALLER_UID=$(id -u)
|
||||||
CALLER_GID=$(id -g)
|
CALLER_GID=$(id -g)
|
||||||
|
|
||||||
|
detect_timezone() {
|
||||||
|
if command -v timedatectl >/dev/null 2>&1; then
|
||||||
|
local tz
|
||||||
|
tz=$(timedatectl show --property=Timezone --value 2>/dev/null)
|
||||||
|
if [ -n "${tz}" ]; then
|
||||||
|
printf '%s\n' "${tz}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/timezone ]; then
|
||||||
|
local tz
|
||||||
|
tz=$(cat /etc/timezone 2>/dev/null)
|
||||||
|
if [ -n "${tz}" ]; then
|
||||||
|
printf '%s\n' "${tz}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v readlink >/dev/null 2>&1; then
|
||||||
|
local link
|
||||||
|
link=$(readlink -f /etc/localtime 2>/dev/null || true)
|
||||||
|
if [ -n "${link}" ] && [[ "${link}" == *zoneinfo/* ]]; then
|
||||||
|
printf '%s\n' "${link##*/zoneinfo/}"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '%s\n' ""
|
||||||
|
}
|
||||||
|
|
||||||
|
HOST_TZ=$(detect_timezone)
|
||||||
|
|
||||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
|
||||||
# Run docker compose from the Docker directory so it picks up the bundled yaml.
|
# Run docker compose from the Docker directory so it picks up the bundled yaml.
|
||||||
(
|
(
|
||||||
cd "${SCRIPT_DIR}"
|
cd "${SCRIPT_DIR}"
|
||||||
LOCAL_UID="${CALLER_UID}" LOCAL_GID="${CALLER_GID}" "${COMPOSE_CMD[@]}" "$@"
|
LOCAL_UID="${CALLER_UID}" LOCAL_GID="${CALLER_GID}" HOST_TZ="${HOST_TZ:-UTC}" "${COMPOSE_CMD[@]}" "$@"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ cd output/Docker
|
|||||||
./run-output-processor.sh up -d
|
./run-output-processor.sh up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
The wrapper auto-detects the Docker Compose plugin or legacy `docker-compose` and forwards any extra arguments (`down`, `logs`, etc.). The stack registers as `RCEO-AI-ResumeCustomizer-Output` with the container `RCEO-AI-ResumeCustomizer-OutputProcessor`.
|
The wrapper auto-detects the Docker Compose plugin or legacy `docker-compose`, forwards any extra arguments (`down`, `logs`, etc.), and passes your UID/GID and current timezone into the container. The stack registers as `RCEO-AI-ResumeCustomizer-Output` with the container `RCEO-AI-ResumeCustomizer-OutputProcessor`.
|
||||||
|
|
||||||
## Conversion Flow
|
## Conversion Flow
|
||||||
1. The watcher polls `ForRelease/inbox` every few seconds for exactly one Markdown resume.
|
1. The watcher polls `ForRelease/inbox` every few seconds for exactly one Markdown resume.
|
||||||
|
|||||||
Reference in New Issue
Block a user