From 05c5d293ebdd07e5cad2481216659e54ef4058eb Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Tue, 22 Feb 2022 01:54:36 +0100 Subject: [PATCH 01/10] Enhance the development compose file --- docker-compose.yml | 48 ++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c76c314c..3935edfb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,6 @@ -version: '3' +version: "3" services: - postgres: - image: postgres:10 - restart: unless-stopped - volumes: - - postgresdata:/var/lib/postgresql/data - - ./config/sql:/config/sql - - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh - environment: - POSTGRES_DB: invidious - POSTGRES_PASSWORD: kemal - POSTGRES_USER: kemal - healthcheck: - test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"] + invidious: build: context: . @@ -21,27 +9,41 @@ services: ports: - "127.0.0.1:3000:3000" environment: - # Adapted from ./config/config.yml INVIDIOUS_CONFIG: | - channel_threads: 1 + # Please read the following file for a comprehensive list of all available + # configuration options and their associated syntax: + # https://github.com/iv-org/invidious/blob/master/config/config.example.yml check_tables: true - feed_threads: 1 db: + dbname: invidious user: kemal password: kemal - host: postgres + host: invidious-postgres port: 5432 - dbname: invidious - full_refresh: false - https_only: false - domain: + # https_only: false + # domain: + # external_port: healthcheck: test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1 interval: 30s timeout: 5s retries: 2 depends_on: - - postgres + - invidious-postgres + + invidious-postgres: + image: postgres:14 + restart: unless-stopped + volumes: + - postgresdata:/var/lib/postgresql/data + - ./config/sql:/config/sql + - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh + environment: + POSTGRES_DB: invidious + POSTGRES_USER: kemal + POSTGRES_PASSWORD: kemal + healthcheck: + test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"] volumes: postgresdata: From 86cb68413db8e399cc0b6ae7aa612fd46a964d37 Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Tue, 22 Feb 2022 02:11:44 +0100 Subject: [PATCH 02/10] Add a comment explaining that it builds an image from source --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 3935edfb..c2cde9f2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,5 @@ +# This docker-compose file is made for development purpose and build an image from source, if you want to use Invidious in production, see the documentation. + version: "3" services: From 7ec88741a6db2f85abf31d5827a408bc7e1d456b Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Tue, 22 Feb 2022 02:24:43 +0100 Subject: [PATCH 03/10] Fix YAML syntax --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c2cde9f2..1008960e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,10 +11,10 @@ services: ports: - "127.0.0.1:3000:3000" environment: - INVIDIOUS_CONFIG: | # Please read the following file for a comprehensive list of all available # configuration options and their associated syntax: # https://github.com/iv-org/invidious/blob/master/config/config.example.yml + INVIDIOUS_CONFIG: | check_tables: true db: dbname: invidious From 385fe4be22cd8ec15b886178b9aa05c3e1273ed6 Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Tue, 22 Feb 2022 02:43:25 +0100 Subject: [PATCH 04/10] Move to an Alpine-based Postgres image --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1008960e..93ff5b6d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,7 +34,7 @@ services: - invidious-postgres invidious-postgres: - image: postgres:14 + image: postgres:14-alpine restart: unless-stopped volumes: - postgresdata:/var/lib/postgresql/data From d90d34700641aa8af0fa718287f2f3daa140ed4f Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Tue, 22 Feb 2022 02:55:42 +0100 Subject: [PATCH 05/10] Re-order the configs in the order of the config file + add statistics_enabled --- docker-compose.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 93ff5b6d..a5da3bb5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,16 +15,17 @@ services: # configuration options and their associated syntax: # https://github.com/iv-org/invidious/blob/master/config/config.example.yml INVIDIOUS_CONFIG: | - check_tables: true db: dbname: invidious user: kemal password: kemal host: invidious-postgres port: 5432 - # https_only: false - # domain: + check_tables: true # external_port: + # domain: + # https_only: false + # statistics_enabled: false healthcheck: test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1 interval: 30s From 9e91fd524111e5633de391dc5328f8d68124606a Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Tue, 22 Feb 2022 03:02:14 +0100 Subject: [PATCH 06/10] Enforce a container_name and rename the postgres container --- docker-compose.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a5da3bb5..96e15105 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,7 @@ version: "3" services: invidious: + container_name: invidious build: context: . dockerfile: docker/Dockerfile @@ -19,7 +20,7 @@ services: dbname: invidious user: kemal password: kemal - host: invidious-postgres + host: invidious-db port: 5432 check_tables: true # external_port: @@ -32,9 +33,10 @@ services: timeout: 5s retries: 2 depends_on: - - invidious-postgres + - invidious-db - invidious-postgres: + invidious-db: + container_name: invidious-db image: postgres:14-alpine restart: unless-stopped volumes: From 5e3fcad1fbea83048e75536c4861154d6d592acb Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Tue, 22 Feb 2022 15:36:15 +0100 Subject: [PATCH 07/10] Remove the enforced container_name following suggestions --- docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 96e15105..38ee0a96 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,6 @@ version: "3" services: invidious: - container_name: invidious build: context: . dockerfile: docker/Dockerfile @@ -36,7 +35,6 @@ services: - invidious-db invidious-db: - container_name: invidious-db image: postgres:14-alpine restart: unless-stopped volumes: From dfcaed93eaf5afc91dec3b2f89cda841aefadbd0 Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Tue, 22 Feb 2022 15:40:11 +0100 Subject: [PATCH 08/10] Enforce the source of the image (mostly for Podman compatibility) --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 38ee0a96..321920bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,7 +35,7 @@ services: - invidious-db invidious-db: - image: postgres:14-alpine + image: docker.io/library/postgres:14-alpine restart: unless-stopped volumes: - postgresdata:/var/lib/postgresql/data From a9d2d2211a777699672519933d50b1f61a570a42 Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com> Date: Tue, 22 Feb 2022 17:31:45 +0000 Subject: [PATCH 09/10] Apply suggestion Co-authored-by: Samantaz Fox --- docker-compose.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 321920bb..4205792e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,8 @@ -# This docker-compose file is made for development purpose and build an image from source, if you want to use Invidious in production, see the documentation. +# Warning: This docker-compose file is made for development purposes. +# Using it will build an image from the locally cloned repository. +# +# If you want to use Invidious in production, see the docker-compose.yml file provided +# in the installation documentation: https://docs.invidious.io/Installation.md version: "3" services: From 16530ac6de4579201191314dafece81b7c38472e Mon Sep 17 00:00:00 2001 From: TheFrenchGhosty Date: Wed, 23 Feb 2022 21:01:12 +0100 Subject: [PATCH 10/10] Move back to a Debian-based Postgres image --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4205792e..cd1df4ff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,7 +39,7 @@ services: - invidious-db invidious-db: - image: docker.io/library/postgres:14-alpine + image: docker.io/library/postgres:14 restart: unless-stopped volumes: - postgresdata:/var/lib/postgresql/data