mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 04:47:27 +00:00
chore: add health-check + docker-compose file for redis/pg
This commit is contained in:
parent
d8333e8163
commit
7ab9dc5996
4 changed files with 30 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ const databaseConfig: DatabaseConfig = {
|
|||
migrations: {
|
||||
naturalSort: true,
|
||||
},
|
||||
healthCheck: false,
|
||||
healthCheck: true,
|
||||
debug: false,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ const redisConfig: RedisConfig = {
|
|||
password: Env.get('REDIS_PASSWORD', ''),
|
||||
db: 0,
|
||||
keyPrefix: '',
|
||||
healthCheck: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
26
server-v2/docker-compose.yml
Normal file
26
server-v2/docker-compose.yml
Normal 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:
|
||||
|
|
@ -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() }
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue