Add a redis cache to gitea

This commit is contained in:
Jake Howard 2020-05-19 21:49:09 +01:00
parent e93dbf2ecf
commit c0c396f008
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 19 additions and 3 deletions

View file

@ -43,7 +43,8 @@ CHARSET = utf8
LOG_SQL = false LOG_SQL = false
[indexer] [indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve ISSUE_INDEXER_QUEUE_TYPE = redis
ISSUE_INDEXER_QUEUE_CONN_STR = addr=redis:6379
[session] [session]
PROVIDER_CONFIG = /data/gitea/sessions PROVIDER_CONFIG = /data/gitea/sessions
@ -94,5 +95,14 @@ ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false ENABLE_OPENID_SIGNUP = false
[cache] [cache]
ADAPTER = memory ADAPTER = redis
INTERVAL = 60 HOST = addr=redis:6379
ITEM_TTL = 168h
[queue]
TYPE = redis
CONN_STR = addr=redis:6379
[queue.task]
TYPE = redis
CONN_STR = addr=redis:6379

View file

@ -21,6 +21,12 @@ services:
- /etc/timezone:/etc/timezone:ro - /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
redis:
image: redis:5-alpine
restart: unless-stopped
volumes:
- ./redis:/data
db: db:
image: postgres:12-alpine image: postgres:12-alpine
restart: unless-stopped restart: unless-stopped