diff --git a/self-host/advanced/timezone.mdx b/self-host/advanced/timezone.mdx new file mode 100644 index 0000000..c5f54ef --- /dev/null +++ b/self-host/advanced/timezone.mdx @@ -0,0 +1,42 @@ +--- +title: "Container Timezone" +description: "Configure the timezone for Pangolin, Gerbil, and Traefik containers to match your local time." +--- + +By default, Docker containers report logs and timestamps in **UTC**. If you want the containers and their log output to use your local timezone, you need to set the timezone in both the container environment and mount the host timezone files. + +## Updating your `docker-compose.yml` + +Add the following to your `pangolin`, `gerbil`, and `traefik` services in `docker-compose.yml`: + +```yaml title="docker-compose.yml" +services: + pangolin: + environment: + - TZ=America/New_York # Set your local timezone + volumes: + - /etc/localtime:/etc/localtime:ro # Sync host timezone + - /etc/timezone:/etc/timezone:ro # Optional: some apps read this file + + gerbil: + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + + traefik: + environment: + - TZ=America/New_York + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro +``` +### Notes + +- **Environment variable `TZ`** ensures most applications inside the container use the correct local timezone. +- **`/etc/localtime` volume** ensures that system utilities (e.g., `date`) inside the container show the correct time. +- **`/etc/timezone` volume** is optional, but some scripts and apps on Debian-based images read it to determine the timezone. +- Logs generated by the containers (including Traefik and Gerbil) will now reflect your local time instead of UTC. + + +Make sure that the host system has the correct timezone configured, as the containers will reference these host files. +