chore: add health-check + docker-compose file for redis/pg

This commit is contained in:
Kalane 2021-09-11 18:08:30 +02:00
parent d8333e8163
commit 7ab9dc5996
4 changed files with 30 additions and 2 deletions

View file

@ -45,7 +45,7 @@ const databaseConfig: DatabaseConfig = {
migrations: {
naturalSort: true,
},
healthCheck: false,
healthCheck: true,
debug: false,
},
},

View file

@ -41,6 +41,7 @@ const redisConfig: RedisConfig = {
password: Env.get('REDIS_PASSWORD', ''),
db: 0,
keyPrefix: '',
healthCheck: true,
},
},
}

View file

@ -0,0 +1,26 @@
version: "3"
services:
leaguestats-redis:
container_name: leaguestats-redis
image: redis:6-alpine
ports:
- '127.0.0.1:6379:6379'
volumes:
- leaguestats-redisData:/data
restart: always
leaguestats-postgres:
container_name: leaguestats-postgres
image: postgres:12-alpine
ports:
- '127.0.0.1:5432:5432'
environment:
- POSTGRES_DB=leaguestats
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- leaguestats-postgresData:/var/lib/postgresql/data
restart: always
volumes:
leaguestats-redisData:
leaguestats-postgresData:

View file

@ -18,8 +18,9 @@
|
*/
import HealthCheck from '@ioc:Adonis/Core/HealthCheck'
import Route from '@ioc:Adonis/Core/Route'
Route.get('/', async () => {
return { hello: 'world from LeagueStats V2' }
return { report: await HealthCheck.getReport() }
})