mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add healthcheck for postgres
This commit is contained in:
parent
9ce8043667
commit
5e87a669de
@ -5,10 +5,14 @@ THEMOVIEDB_APIKEY=
|
|||||||
PUBLIC_BACK_URL=http://localhost:5000
|
PUBLIC_BACK_URL=http://localhost:5000
|
||||||
AUTHENTICATION_SECRET=
|
AUTHENTICATION_SECRET=
|
||||||
|
|
||||||
|
# Following options are optional and only useful for debugging.
|
||||||
|
|
||||||
# To debug the front end, you can set the following to an external backend
|
# To debug the front end, you can set the following to an external backend
|
||||||
KYOO_URL=https://kyoo.sdg.moe/api
|
KYOO_URL=https://kyoo.sdg.moe/api
|
||||||
|
# The library root inside the container.
|
||||||
|
KYOO_LIBRARY_ROOT=/video
|
||||||
|
|
||||||
# Database things (optional)
|
# Database things
|
||||||
POSTGRES_USER=KyooUser
|
POSTGRES_USER=KyooUser
|
||||||
POSTGRES_PASSWORD=KyooPassword
|
POSTGRES_PASSWORD=KyooPassword
|
||||||
POSTGRES_DB=kyooDB
|
POSTGRES_DB=kyooDB
|
||||||
|
@ -61,7 +61,7 @@ namespace Kyoo.Core.Tasks
|
|||||||
{
|
{
|
||||||
ICollection<Provider> providers = await _libraryManager.GetAll<Provider>();
|
ICollection<Provider> providers = await _libraryManager.GetAll<Provider>();
|
||||||
ICollection<string> existings = (await _libraryManager.GetAll<Library>()).SelectMany(x => x.Paths).ToArray();
|
ICollection<string> existings = (await _libraryManager.GetAll<Library>()).SelectMany(x => x.Paths).ToArray();
|
||||||
IEnumerable<Library> newLibraries = Directory.GetDirectories(Environment.GetEnvironmentVariable("LIBRARY_ROOT") ?? "/video")
|
IEnumerable<Library> newLibraries = Directory.GetDirectories(Environment.GetEnvironmentVariable("KYOO_LIBRARY_ROOT") ?? "/video")
|
||||||
.Where(x => !existings.Contains(x))
|
.Where(x => !existings.Contains(x))
|
||||||
.Select(x => new Library
|
.Select(x => new Library
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,8 @@ services:
|
|||||||
- ./back:/app
|
- ./back:/app
|
||||||
- /app/out/
|
- /app/out/
|
||||||
- kyoo:/kyoo
|
- kyoo:/kyoo
|
||||||
- ./video:/video
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
front:
|
front:
|
||||||
build:
|
build:
|
||||||
context: ./front
|
context: ./front
|
||||||
@ -34,6 +35,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
||||||
- PUBLIC_BACK_URL=${PUBLIC_BACK_URL}
|
- PUBLIC_BACK_URL=${PUBLIC_BACK_URL}
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
image: nginx
|
image: nginx
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
@ -48,6 +50,7 @@ services:
|
|||||||
- front
|
- front
|
||||||
ports:
|
ports:
|
||||||
- "8901:8901"
|
- "8901:8901"
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: "postgres"
|
image: "postgres"
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
@ -55,6 +58,11 @@ services:
|
|||||||
- ./.env
|
- ./.env
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
kyoo:
|
kyoo:
|
||||||
|
@ -11,13 +11,15 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- kyoo:/kyoo
|
- kyoo:/kyoo
|
||||||
- ./cache:/kyoo/cached
|
- ./cache:/kyoo/cached
|
||||||
- ./video:/video
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
front:
|
front:
|
||||||
image: zoriya/kyoo_front:edge
|
image: zoriya/kyoo_front:edge
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
||||||
- PUBLIC_BACK_URL=${PUBLIC_BACK_URL}
|
- PUBLIC_BACK_URL=${PUBLIC_BACK_URL}
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
image: nginx
|
image: nginx
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
@ -32,6 +34,7 @@ services:
|
|||||||
- front
|
- front
|
||||||
ports:
|
ports:
|
||||||
- "8901:8901"
|
- "8901:8901"
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres
|
image: postgres
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
@ -39,6 +42,11 @@ services:
|
|||||||
- ./.env
|
- ./.env
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
kyoo:
|
kyoo:
|
||||||
|
@ -11,13 +11,15 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- kyoo:/kyoo
|
- kyoo:/kyoo
|
||||||
- ./cache:/kyoo/cached
|
- ./cache:/kyoo/cached
|
||||||
- ./video:/video
|
- ${LIBRARY_ROOT}:/video
|
||||||
|
|
||||||
front:
|
front:
|
||||||
build: ./front
|
build: ./front
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
||||||
- PUBLIC_BACK_URL=${PUBLIC_BACK_URL}
|
- PUBLIC_BACK_URL=${PUBLIC_BACK_URL}
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
image: nginx
|
image: nginx
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
@ -32,6 +34,7 @@ services:
|
|||||||
- front
|
- front
|
||||||
ports:
|
ports:
|
||||||
- "8901:8901"
|
- "8901:8901"
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres
|
image: postgres
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
@ -39,6 +42,11 @@ services:
|
|||||||
- ./.env
|
- ./.env
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/postgresql/data
|
- db:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
kyoo:
|
kyoo:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user