inukshuk / sqleton

Visualize your SQLite database schema
GNU General Public License v3.0
110 stars 12 forks source link

containerized sqleton cannot find sqlite3 #17

Closed aldobranti closed 8 months ago

aldobranti commented 8 months ago

I have to run sqleton in Docker if I want to access a sqlite database in a NAS environment.

I have this Dockerfile `FROM alpine:latest

RUN apk add git RUN apk add graphviz RUN apk add nodejs npm RUN git clone https://github.com/inukshuk/sqleton.git RUN npm i sqlite3 -g`

build it docker build . -t sqleton and execute at the linux shell docker run --rm -v/home:/home -v/srv:/srv -it sqleton sh

in the container, I can check location of the dbms and then I would aim to enter a command like sqleton -L dot -e -o dot-thing.dot /home/pi/.home-assistant/home-assistant_v2.db

but I have had problems, so I check out sqleton `/ # /sqleton/bin/sqleton -h node:internal/modules/cjs/loader:1080 throw err; ^

Error: Cannot find module 'sqlite3' Require stack:

Node.js v18.18.2`

I am very ropy/out of date in JS programming so what is going on here?

inukshuk commented 8 months ago

Why do you clone the repository instead of installing it via npm?

aldobranti commented 8 months ago

Being of the meganube nature and knowing zilch about js and npm I did what I thought was the standard way. I'll surely try it out and let you know. And thanks for replying A

On Fri, 20 Oct 2023, 09:26 Sylvester Keil, @.***> wrote:

Why do you clone the repository instead of installing it via npm?

— Reply to this email directly, view it on GitHub https://github.com/inukshuk/sqleton/issues/17#issuecomment-1772301993, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJVMHYOUSNYDDOMHPFDKETYAIYVBAVCNFSM6AAAAAA6IUL7A2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZSGMYDCOJZGM . You are receiving this because you authored the thread.Message ID: @.***>

aldobranti commented 8 months ago

OK -- having picked up some tips I have a working and containerised sqleton and a happy system manager and for the record a working Dockerfile

`FROM alpine:latest

RUN mkdir /app WORKDIR /app

NB! obligatory use of WORKDIR

RUN apk add graphviz npm RUN npm install sqleton CMD /app/node_modules/sqleton/bin/sqleton -h`

adapt CMD to particular need e.g. docker build . -t sqleton docker run --rm -it -v/srv:/srv -v/home:/home sqleton sqleton -L dot -e -o dot-thing.dot /home/pi/.home-assistant/home-assistant_v2.db

&& thanks for creating sqleton -- I now have an elegant graphviz of my Home Assitant db