I'm running https-portal in a Docker container, but I've noticed that some containers have their timezone still in UTC. .. I'm having trouble viewing the log, so I'd like to change to JST.
The time zone is UTC.
$ docker-compose exec https-portal sh
# date
Sun Oct 25 03:36:07 UTC 2020
Let's set it with docker-compose.
docker-compose.yml
version: '3'
services:
https-portal:
container_name: https-portal
image: steveltn/https-portal:1
ports:
- '80:80'
- '443:443'
restart: always
environment:
DOMAINS: 'example.net -> https://kusanagi01_httpd:8443 #production, example.com -> https://kusanagi02_httpd:8443 #local'
ERROR_LOG: stderr
ACCESS_LOG: stdout
CLIENT_MAX_BODY_SIZE: 16M
TZ: Asia/Tokyo #add to
networks:
- shared-network
networks:
shared-network:
external: true
Recreate the container. I was able to confirm that it was changed to JST.
$ docker-compose stop
Stopping https-portal ... done
$ docker-compose up -d
Recreating https-portal ... done
$ docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------
https-portal /init Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
$ docker-compose exec https-portal sh
# date
Sun Oct 25 12:49:10 JST 2020
Recommended Posts