duckdb / duckdb-node

MIT License
56 stars 27 forks source link

Nodejs app crash when running inside node:18.17-alpine3.18 container #43

Open OferLazmi opened 10 months ago

OferLazmi commented 10 months ago

same app in running as expected in windows machine but when deploying it into node:18.17-alpine3.18 container it crashes i removed the duckDb code and everything works.

Here is the code that causes the crash:

return new Promise(async (resolve, reject) => { try { let query = INSTALL httpfs; LOAD httpfs; ; this.db = new duckdb.Database(':memory:'); this.db.all(query, (err, res) => { if (err) {
reject(err); return; } resolve(res); }); } catch (error) { reject(error); } });

did someone encountered this kind of problem?

this is my dockerfile:

FROM node:18.17-alpine3.18 AS production

ENV DISPLAY=:1.0 ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV}

WORKDIR /usr/src/app

COPY package.json ./ COPY tsconfig.json ./

COPY src /usr/src/app/src COPY config /usr/src/app/config

RUN apk add libc6-compat RUN apk add gcompat

RUN npm install glob rimraf RUN npm install --only=production RUN npm run build CMD uname -m && npm run start:prod

nabriski commented 10 months ago

yes, I had to switch to a Debian image. It appears the duckdb is not compiled to run on Alpine.