emanuelegori

emanuelegori / BookOrbit

Last active 16 hours ago

Like 0

BookOrbit è una piattaforma self‑hosted e open source per gestire e leggere ebook, audiolibri e fumetti. Offre lettori integrati per più formati, gestione automatica dei metadati, sincronizzazione con Kobo e KOReader, supporto multi‑utente con SSO, cataloghi OPDS privati e analitiche di lettura avanzate, il tutto con una semplice distribuzione via Docker e senza abbonamenti.

emanuelegori revised this gist 16 hours ago · 65a8a9b

No changes

emanuelegori revised this gist 16 hours ago · f453b10

1 file changed, 1 insertion

docker-compose.yml
@@ -43,6 +43,7 @@ services:
43 43 - no-new-privileges:true
44 44 stop_grace_period: 30s
45 45 networks:
46 + - default
46 47 - npm-network
47 48 healthcheck:
48 49 test:

emanuelegori revised this gist 17 hours ago · e15ad68

1 file changed, 8 insertions, 1 deletion

docker-compose.yml
@@ -42,6 +42,8 @@ services:
42 42 security_opt:
43 43 - no-new-privileges:true
44 44 stop_grace_period: 30s
45 + networks:
46 + - npm-network
45 47 healthcheck:
46 48 test:
47 49 [
@@ -70,4 +72,9 @@ services:
70 72 interval: 10s
71 73 timeout: 5s
72 74 retries: 10
73 - start_period: 20s
75 + start_period: 20s
76 +
77 + networks:
78 + npm-network:
79 + name: npm-network
80 + external: true

emanuelegori revised this gist 21 hours ago · 7ce16bf

1 file changed, 25 insertions, 31 deletions

docker-compose.yml
@@ -1,37 +1,33 @@
1 1 services:
2 - app:
2 + bookorbit:
3 3 container_name: bookorbit-app
4 - image: ${APP_IMAGE?required}
4 + image: ghcr.io/bookorbit/bookorbit:latest
5 5 restart: unless-stopped
6 6 init: true
7 - env_file:
8 - - .env
9 7 ports:
10 - - "${APP_PORT:-3000}:${PORT:-3000}"
8 + - "3000:3000"
11 9 environment:
12 10 NODE_ENV: production
13 - PORT: ${PORT:-3000}
14 - DATABASE_URL: ${DATABASE_URL:-}
15 - POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
16 - POSTGRES_PORT: ${POSTGRES_PORT:-5432}
17 - POSTGRES_USER: ${POSTGRES_USER?required}
18 - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?required}
19 - POSTGRES_DB: ${POSTGRES_DB?required}
20 - JWT_SECRET: ${JWT_SECRET?required}
21 - SETUP_BOOTSTRAP_TOKEN: ${SETUP_BOOTSTRAP_TOKEN?required}
22 - APP_URL: ${APP_URL?required}
23 - CLIENT_URL: ${CLIENT_URL:-${APP_URL?required}}
24 - PUID: ${PUID:-1000}
25 - PGID: ${PGID:-1000}
26 - NODE_MAX_OLD_SPACE_SIZE: ${NODE_MAX_OLD_SPACE_SIZE:-auto}
27 - BOOK_DOCK_PATH: ${BOOK_DOCK_PATH:-}
28 - LIBRARY_BROWSE_ROOT: ${LIBRARY_BROWSE_ROOT:-}
11 + PORT: 3000
12 + POSTGRES_HOST: postgres
13 + POSTGRES_PORT: 5432
14 + POSTGRES_USER: bookorbit
15 + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
16 + POSTGRES_DB: bookorbit
17 + JWT_SECRET: ${JWT_SECRET}
18 + SETUP_BOOTSTRAP_TOKEN: ${SETUP_BOOTSTRAP_TOKEN}
19 + APP_URL: https://libri.tuodominio.it
20 + CLIENT_URL: https://libri.tuodominio.it
21 + PUID: 1000
22 + PGID: 1000
23 + NODE_MAX_OLD_SPACE_SIZE: 2048
29 24 depends_on:
30 25 postgres:
31 26 condition: service_healthy
32 27 volumes:
33 - - ${BOOKS_HOST_PATH:-./books}:/books
28 + - ./books:/books
34 29 - ./data/app:/data
30 + - ./data/app/book-dock:/data/book-dock
35 31 read_only: true
36 32 tmpfs:
37 33 - /tmp
@@ -49,24 +45,22 @@ services:
49 45 healthcheck:
50 46 test:
51 47 [
52 - "CMD",
53 - "node",
54 - "-e",
55 - "const p=process.env.PORT||3000;fetch('http://127.0.0.1:'+p+'/api/v1/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
48 + "CMD-SHELL",
49 + 'node -e "fetch(''http://127.0.0.1:3000/api/v1/health'').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"',
56 50 ]
57 51 interval: 30s
58 52 timeout: 5s
59 53 retries: 3
60 54 start_period: 20s
61 -
55 +
62 56 postgres:
63 57 container_name: bookorbit-db
64 - image: pgvector/pgvector:pg18
58 + image: pgvector/pgvector:pg16@sha256:7d400e340efb42f4d8c9c12c6427adb253f726881a9985d2a471bf0eed824dff
65 59 restart: unless-stopped
66 60 environment:
67 - POSTGRES_USER: ${POSTGRES_USER?required}
68 - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?required}
69 - POSTGRES_DB: ${POSTGRES_DB?required}
61 + POSTGRES_USER: bookorbit
62 + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
63 + POSTGRES_DB: bookorbit
70 64 PGDATA: /var/lib/postgresql/data/pgdata
71 65 volumes:
72 66 - ./data/postgres:/var/lib/postgresql/data

emanuelegori revised this gist 1 day ago · 150ef75

1 file changed, 79 insertions

docker-compose.yml (file created)
@@ -0,0 +1,79 @@
1 + services:
2 + app:
3 + container_name: bookorbit-app
4 + image: ${APP_IMAGE?required}
5 + restart: unless-stopped
6 + init: true
7 + env_file:
8 + - .env
9 + ports:
10 + - "${APP_PORT:-3000}:${PORT:-3000}"
11 + environment:
12 + NODE_ENV: production
13 + PORT: ${PORT:-3000}
14 + DATABASE_URL: ${DATABASE_URL:-}
15 + POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
16 + POSTGRES_PORT: ${POSTGRES_PORT:-5432}
17 + POSTGRES_USER: ${POSTGRES_USER?required}
18 + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?required}
19 + POSTGRES_DB: ${POSTGRES_DB?required}
20 + JWT_SECRET: ${JWT_SECRET?required}
21 + SETUP_BOOTSTRAP_TOKEN: ${SETUP_BOOTSTRAP_TOKEN?required}
22 + APP_URL: ${APP_URL?required}
23 + CLIENT_URL: ${CLIENT_URL:-${APP_URL?required}}
24 + PUID: ${PUID:-1000}
25 + PGID: ${PGID:-1000}
26 + NODE_MAX_OLD_SPACE_SIZE: ${NODE_MAX_OLD_SPACE_SIZE:-auto}
27 + BOOK_DOCK_PATH: ${BOOK_DOCK_PATH:-}
28 + LIBRARY_BROWSE_ROOT: ${LIBRARY_BROWSE_ROOT:-}
29 + depends_on:
30 + postgres:
31 + condition: service_healthy
32 + volumes:
33 + - ${BOOKS_HOST_PATH:-./books}:/books
34 + - ./data/app:/data
35 + read_only: true
36 + tmpfs:
37 + - /tmp
38 + cap_drop:
39 + - ALL
40 + cap_add:
41 + - CHOWN
42 + - DAC_OVERRIDE
43 + - FOWNER
44 + - SETGID
45 + - SETUID
46 + security_opt:
47 + - no-new-privileges:true
48 + stop_grace_period: 30s
49 + healthcheck:
50 + test:
51 + [
52 + "CMD",
53 + "node",
54 + "-e",
55 + "const p=process.env.PORT||3000;fetch('http://127.0.0.1:'+p+'/api/v1/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))",
56 + ]
57 + interval: 30s
58 + timeout: 5s
59 + retries: 3
60 + start_period: 20s
61 +
62 + postgres:
63 + container_name: bookorbit-db
64 + image: pgvector/pgvector:pg18
65 + restart: unless-stopped
66 + environment:
67 + POSTGRES_USER: ${POSTGRES_USER?required}
68 + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD?required}
69 + POSTGRES_DB: ${POSTGRES_DB?required}
70 + PGDATA: /var/lib/postgresql/data/pgdata
71 + volumes:
72 + - ./data/postgres:/var/lib/postgresql/data
73 + healthcheck:
74 + test:
75 + ["CMD-SHELL", 'pg_isready -U "$${POSTGRES_USER}" -d "$${POSTGRES_DB}"']
76 + interval: 10s
77 + timeout: 5s
78 + retries: 10
79 + start_period: 20s