Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sqlite max variable number error #282

Open
wants to merge 2 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions .build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
# syntax = docker/dockerfile-upstream:master-labs
FROM ubuntu:20.04 as build
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y curl bash
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y nodejs gcc g++ make libpixman-1-dev libcairo2-dev libpango1.0-dev libjpeg8-dev libgif-dev jq

RUN --mount=type=tmpfs,target=/var/cache/apt <<EOT
#!/bin/bash
apt-get update && apt-get install -y curl bash
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs gcc g++ make libpixman-1-dev libcairo2-dev libpango1.0-dev libjpeg8-dev libgif-dev jq unzip wget
EOT
WORKDIR /double-take/api
COPY /api/package.json .
RUN npm install --production
RUN --mount=type=tmpfs,target=/src <<EOT
#!/bin/bash
mkdir -p /src
cd /src
wget https://sqlite.org/2022/sqlite-amalgamation-3380500.zip
unzip sqlite-amalgamation-3380500.zip && rm sqlite-amalgamation-3380500.zip
mv sqlite* sqlite
cd sqlite
sed -i '1i #define SQLITE_MAX_VARIABLE_NUMBER 65532' sqlite3.c

cd /double-take/api
npm install --production
curl -L https://gobinaries.com/tj/node-prune | /bin/sh && node-prune
EOT

WORKDIR /double-take/frontend
COPY /frontend/package.json .
Expand All @@ -23,7 +39,7 @@ COPY /frontend/public ./public
COPY /frontend/.env.production /frontend/vue.config.js /frontend/babel.config.js /frontend/.eslintrc.js ./

RUN npm run build
RUN mv dist /tmp/dist && rm -r * && mv /tmp/dist/* .
RUN --mount=type=tmpfs,target=/tmp mv dist /tmp/dist && rm -r * && mv /tmp/dist/* .

WORKDIR /
RUN mkdir /.storage
Expand Down
4 changes: 2 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Unified UI and API for processing and training images for facial recognition",
"scripts": {
"start": "node server.js",
"debug": "nodemon server.js"
"debug": "nodemon server.js",
"preinstall": "npm install better-sqlite3@'^7.5.3' --no-save --build-from-source --sqlite3=\"/src/sqlite\""
},
"repository": {
"type": "git",
Expand All @@ -21,7 +22,6 @@
"@mhoc/axios-digest-auth": "^0.8.0",
"archiver": "^5.3.1",
"axios": "^0.27.2",
"better-sqlite3": "^7.5.3",
"canvas": "^2.9.1",
"cors": "^2.8.5",
"execution-time": "^1.4.1",
Expand Down