1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

https-portalコンテナのタイムゾーンをJSTに変更する

Posted at

https-portalをDockerコンテナで運用していますが、タイムゾーンがUTCのままになっているコンテナがあることに気が付いてしまいました。
ログ見るときに困るのでJSTに変えたいと思います。

  • https-portal

タイムゾーンはUTCになっています。

$ docker-compose exec https-portal sh
# date
Sun Oct 25 03:36:07 UTC 2020

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                                                #追加
    networks:
      - shared-network

networks:
  shared-network:
    external: true

コンテナを作り直します。
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
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?