mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-08 10:44:20 -04:00
Migrate from nginx to traefik (#450)
This commit is contained in:
commit
a8b25b9ef6
2
.github/workflows/robot.yml
vendored
2
.github/workflows/robot.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Start the service
|
- name: Start the service
|
||||||
run: |
|
run: |
|
||||||
docker compose up -d back postgres ingress meilisearch # --wait Wait is not available on gha
|
docker compose up -d back postgres traefik meilisearch --wait
|
||||||
|
|
||||||
- name: Perform healthchecks
|
- name: Perform healthchecks
|
||||||
run: |
|
run: |
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
1. Install docker & docker-compose
|
1. Install docker & docker-compose
|
||||||
2. Download the
|
2. Download the
|
||||||
[`docker-compose.yml`](https://github.com/zoriya/kyoo/releases/latest/download/docker-compose.yml),
|
[`docker-compose.yml`](https://github.com/zoriya/kyoo/releases/latest/download/docker-compose.yml) and
|
||||||
[`nginx.conf.template`](https://raw.githubusercontent.com/zoriya/Kyoo/master/nginx.conf.template) and
|
|
||||||
[`.env`](https://raw.githubusercontent.com/zoriya/Kyoo/master/.env.example) files
|
[`.env`](https://raw.githubusercontent.com/zoriya/Kyoo/master/.env.example) files
|
||||||
3. Fill the `.env` file with your configuration options (and an API Key from [themoviedb.org](https://www.themoviedb.org/))
|
3. Fill the `.env` file with your configuration options (and an API Key from [themoviedb.org](https://www.themoviedb.org/))
|
||||||
4. Look at [Hardware Acceleration section](#Hardware-Acceleration) if you need it
|
4. Look at [Hardware Acceleration section](#Hardware-Acceleration) if you need it
|
||||||
@ -17,18 +16,16 @@ To install Kyoo, you need docker and docker-compose. Those can be installed from
|
|||||||
or [Windows](https://docs.docker.com/desktop/install/windows-install/). Docker is used to run each services of Kyoo in
|
or [Windows](https://docs.docker.com/desktop/install/windows-install/). Docker is used to run each services of Kyoo in
|
||||||
an isolated environment with all the dependencies they need.
|
an isolated environment with all the dependencies they need.
|
||||||
|
|
||||||
Kyoo also needs 3 files to work properly. Two of them can simply be copy-pasted from this repository, the other needs to be filled in with your configurations.
|
Kyoo also needs 2 files to work properly. The first should be downloaded from the latest release artificat, the other needs to be filled in with your configurations.
|
||||||
Those files can be put in any directory of your choice.
|
Those files can be put in any directory of your choice.
|
||||||
|
|
||||||
Those 3 files are:
|
Those files are:
|
||||||
|
|
||||||
- A `docker-compose.yml` (simply download docker-compose.yml from [the latest release](https://github.com/zoriya/kyoo/releases/latest/download/docker-compose.yml)).
|
- A `docker-compose.yml` (simply download docker-compose.yml from [the latest release](https://github.com/zoriya/kyoo/releases/latest/download/docker-compose.yml)).
|
||||||
- A `nginx.conf.template` copied from [here](https://raw.githubusercontent.com/zoriya/Kyoo/master/nginx.conf.template).
|
|
||||||
- A `.env` file that you will need to **fill**. Look at the example [.env.example](https://raw.githubusercontent.com/zoriya/Kyoo/master/.env.example)
|
- A `.env` file that you will need to **fill**. Look at the example [.env.example](https://raw.githubusercontent.com/zoriya/Kyoo/master/.env.example)
|
||||||
|
|
||||||
> If you want an explanation of what are those files, you can read the following:
|
> If you want an explanation of what are those files, you can read the following:
|
||||||
> The `docker-compose.yml` file describes the different services of Kyoo, where they should be downloaded and their start order. \
|
> The `docker-compose.yml` file describes the different services of Kyoo, where they should be downloaded and their start order. \
|
||||||
> The `nignx.conf.template` file describes which service will be called when accessing the URL of Kyoo. \
|
|
||||||
> The `.env` file contains all the configuration options that the services in `docker-compose.yml` will read.
|
> The `.env` file contains all the configuration options that the services in `docker-compose.yml` will read.
|
||||||
|
|
||||||
To retrieve metadata, Kyoo will need to communicate with an external service. For now, that is `the movie database`.
|
To retrieve metadata, Kyoo will need to communicate with an external service. For now, that is `the movie database`.
|
||||||
@ -44,7 +41,7 @@ Congratulation, everything is now ready to use Kyoo. You can navigate to `http:/
|
|||||||
|
|
||||||
# Updating
|
# Updating
|
||||||
|
|
||||||
Updating Kyoo is exactly the same as installing it. Get an updated version of the `docker-compose.yml` and `nginx.conf.template` files and
|
Updating Kyoo is exactly the same as installing it. Get an updated version of the `docker-compose.yml` file and
|
||||||
unsure that your `.env` contains all the options specified in the updated `.env.example` file.
|
unsure that your `.env` contains all the options specified in the updated `.env.example` file.
|
||||||
|
|
||||||
After that, you will need to update Kyoo's services. For that, open a terminal in the configuration's directory and run
|
After that, you will need to update Kyoo's services. For that, open a terminal in the configuration's directory and run
|
||||||
|
@ -33,6 +33,12 @@ services:
|
|||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
volumes:
|
volumes:
|
||||||
- kyoo:/metadata
|
- kyoo:/metadata
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.api.rule=PathPrefix(`/api/`)"
|
||||||
|
- "traefik.http.routers.api.middlewares=api-sp"
|
||||||
|
- "traefik.http.middlewares.api-sp.stripprefix.prefixes=/api"
|
||||||
|
- "traefik.http.middlewares.api-sp.stripprefix.forceSlash=false"
|
||||||
|
|
||||||
migrations:
|
migrations:
|
||||||
build:
|
build:
|
||||||
@ -50,6 +56,9 @@ services:
|
|||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.front.rule=PathPrefix(`/`)"
|
||||||
|
|
||||||
scanner:
|
scanner:
|
||||||
build: ./scanner
|
build: ./scanner
|
||||||
@ -121,20 +130,17 @@ services:
|
|||||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||||
profiles: ['qsv']
|
profiles: ['qsv']
|
||||||
|
|
||||||
ingress:
|
traefik:
|
||||||
image: nginx
|
image: traefik:v2.11
|
||||||
restart: on-failure
|
command:
|
||||||
environment:
|
- "--providers.docker=true"
|
||||||
- PORT=8901
|
- "--providers.docker.exposedbydefault=false"
|
||||||
- FRONT_URL=http://front:8901
|
- "--entryPoints.web.address=:8901"
|
||||||
- BACK_URL=${KYOO_URL:-http://back:5000}
|
- "--accesslog=true"
|
||||||
volumes:
|
|
||||||
- ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro
|
|
||||||
depends_on:
|
|
||||||
- back
|
|
||||||
- front
|
|
||||||
ports:
|
ports:
|
||||||
- "8901:8901"
|
- "8901:8901"
|
||||||
|
volumes:
|
||||||
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
|
@ -45,6 +45,12 @@ services:
|
|||||||
- ./back:/app
|
- ./back:/app
|
||||||
- /app/out/
|
- /app/out/
|
||||||
- kyoo:/metadata
|
- kyoo:/metadata
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.api.rule=PathPrefix(`/api/`)"
|
||||||
|
- "traefik.http.routers.api.middlewares=api-sp"
|
||||||
|
- "traefik.http.middlewares.api-sp.stripprefix.prefixes=/api"
|
||||||
|
- "traefik.http.middlewares.api-sp.stripprefix.forceSlash=false"
|
||||||
|
|
||||||
migrations:
|
migrations:
|
||||||
build:
|
build:
|
||||||
@ -74,6 +80,9 @@ services:
|
|||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.front.rule=PathPrefix(`/`)"
|
||||||
|
|
||||||
scanner:
|
scanner:
|
||||||
build: ./scanner
|
build: ./scanner
|
||||||
@ -145,17 +154,17 @@ services:
|
|||||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||||
profiles: ['qsv']
|
profiles: ['qsv']
|
||||||
|
|
||||||
ingress:
|
traefik:
|
||||||
image: nginx
|
image: traefik:v2.11
|
||||||
restart: on-failure
|
command:
|
||||||
environment:
|
- "--providers.docker=true"
|
||||||
- PORT=8901
|
- "--providers.docker.exposedbydefault=false"
|
||||||
- FRONT_URL=http://front:3000
|
- "--entryPoints.web.address=:8901"
|
||||||
- BACK_URL=${KYOO_URL:-http://back:5000}
|
- "--accesslog=true"
|
||||||
volumes:
|
|
||||||
- ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro
|
|
||||||
ports:
|
ports:
|
||||||
- "8901:8901"
|
- "8901:8901"
|
||||||
|
volumes:
|
||||||
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
|
@ -34,6 +34,12 @@ services:
|
|||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
volumes:
|
volumes:
|
||||||
- kyoo:/metadata
|
- kyoo:/metadata
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.api.rule=PathPrefix(`/api/`)"
|
||||||
|
- "traefik.http.routers.api.middlewares=api-sp"
|
||||||
|
- "traefik.http.middlewares.api-sp.stripprefix.prefixes=/api"
|
||||||
|
- "traefik.http.middlewares.api-sp.stripprefix.forceSlash=false"
|
||||||
|
|
||||||
migrations:
|
migrations:
|
||||||
image: ghcr.io/zoriya/kyoo_migrations:edge
|
image: ghcr.io/zoriya/kyoo_migrations:edge
|
||||||
@ -49,6 +55,9 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
- KYOO_URL=${KYOO_URL:-http://back:5000}
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.front.rule=PathPrefix(`/`)"
|
||||||
|
|
||||||
scanner:
|
scanner:
|
||||||
image: ghcr.io/zoriya/kyoo_scanner:edge
|
image: ghcr.io/zoriya/kyoo_scanner:edge
|
||||||
@ -120,20 +129,17 @@ services:
|
|||||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||||
profiles: ['qsv']
|
profiles: ['qsv']
|
||||||
|
|
||||||
ingress:
|
traefik:
|
||||||
image: nginx
|
image: traefik:v2.11
|
||||||
restart: unless-stopped
|
command:
|
||||||
environment:
|
- "--providers.docker=true"
|
||||||
- PORT=8901
|
- "--providers.docker.exposedbydefault=false"
|
||||||
- FRONT_URL=http://front:8901
|
- "--entryPoints.web.address=:8901"
|
||||||
- BACK_URL=${KYOO_URL:-http://back:5000}
|
- "--accesslog=true"
|
||||||
volumes:
|
|
||||||
- ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro
|
|
||||||
depends_on:
|
|
||||||
- back
|
|
||||||
- front
|
|
||||||
ports:
|
ports:
|
||||||
- "8901:8901"
|
- "8901:8901"
|
||||||
|
volumes:
|
||||||
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
server {
|
|
||||||
listen ${PORT};
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass ${FRONT_URL};
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass ${BACK_URL}/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user