diff --git a/Dockerfile b/Dockerfile index acd7803..afefa3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,5 +25,7 @@ COPY --from=build /app/scripts ./scripts COPY --from=build /app/prisma ./prisma COPY --from=build /app/node_modules ./node_modules +RUN rm -rf ./prisma/engines + # Run the application. CMD npm run start diff --git a/Dockerfile.armv7 b/Dockerfile.armv7 new file mode 100644 index 0000000..e001a54 --- /dev/null +++ b/Dockerfile.armv7 @@ -0,0 +1,40 @@ +# syntax=docker/dockerfile:1 + +# base +FROM arm32v7/node:18 as base + +WORKDIR /app + +COPY prisma/engines ./prisma/engines + +RUN chmod +x ./prisma/engines/query-engine +RUN chmod +x ./prisma/engines/libquery_engine.so.node +RUN chmod +x ./prisma/engines/schema-engine + +ENV PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1 +ENV PRISMA_QUERY_ENGINE_BINARY=./prisma/engines/query-engine +ENV PRISMA_QUERY_ENGINE_LIBRARY=./prisma/engines/libquery_engine.so.node +ENV PRISMA_SCHEMA_ENGINE_BINARY=./prisma/engines/schema-engine + +# build +FROM base as build + +RUN --mount=type=cache,target=/root/.npm \ + npm install -g pnpm@9.1.1 + +COPY . . + +RUN --mount=type=cache,target=/root/.local/share/pnpm/store \ + pnpm install && pnpm build && npx prisma -v + +# run +FROM base + +COPY package.json . +COPY --from=build /app/dist ./dist +COPY --from=build /app/scripts ./scripts +COPY --from=build /app/prisma ./prisma +COPY --from=build /app/node_modules ./node_modules + +# Run the application. +CMD npm run start diff --git a/package.json b/package.json index 7c1c2cc..1ef2ae3 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ ], "scripts": { "start": "node ./scripts/runner.js", - "build": "pnpm prisma generate && tsup", - "db:gen": "pnpm prisma migrate dev --name init", + "build": "npx -y prisma generate && tsup", + "db:gen": "npx -y prisma migrate dev --name init", "db:reset": "rm -f .mi.json .bot.json prisma/app.db prisma/app.db-journal" }, "dependencies": { diff --git a/prisma/engines/libquery_engine.so.node b/prisma/engines/libquery_engine.so.node new file mode 100644 index 0000000..b595640 Binary files /dev/null and b/prisma/engines/libquery_engine.so.node differ diff --git a/prisma/engines/query-engine b/prisma/engines/query-engine new file mode 100644 index 0000000..dc853a9 Binary files /dev/null and b/prisma/engines/query-engine differ diff --git a/prisma/engines/schema-engine b/prisma/engines/schema-engine new file mode 100755 index 0000000..d6c7fe6 Binary files /dev/null and b/prisma/engines/schema-engine differ