From 6b824ce33a71f37b77341cf18295dcf0e563e862 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Tue, 8 Aug 2023 20:44:15 +0200 Subject: [PATCH] =?UTF-8?q?Oprava=20=C4=8Dasov=C3=A9=20z=C3=B3ny=20a=20v?= =?UTF-8?q?=C3=BDb=C4=9Bru=20storage=20dle=20.env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/App.tsx | 9 +++++---- docker-compose.yml | 6 +++++- server/src/storage/index.ts | 5 +++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index da427e5..86954d3 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -278,10 +278,11 @@ function App() { Poslední změny:

Dnes je {data.date}

diff --git a/docker-compose.yml b/docker-compose.yml index d76d6cc..1ba2767 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: #expose: # - 6379 environment: - - REDIS_ARGS=--save 43200 1 --loglevel warning + - REDIS_ARGS=--save 3600 1 --loglevel warning volumes: - redis:/data luncher: @@ -20,6 +20,10 @@ services: context: ./ ports: - 3001:3001 + environment: + - TZ=Europe/Prague + volumes: + - "/etc/timezone:/etc/timezone:ro" volumes: redis: driver: local diff --git a/server/src/storage/index.ts b/server/src/storage/index.ts index 4786bc3..082d492 100644 --- a/server/src/storage/index.ts +++ b/server/src/storage/index.ts @@ -1,7 +1,12 @@ +import dotenv from 'dotenv'; +import path from 'path'; import { StorageInterface } from "./StorageInterface"; import JsonStorage from "./json"; import RedisStorage from "./redis"; +const ENVIRONMENT = process.env.NODE_ENV || 'production'; +dotenv.config({ path: path.resolve(__dirname, `../.env.${ENVIRONMENT}`) }); + const JSON_KEY = 'json'; const REDIS_KEY = 'redis';