bytemate / chatapi-single

Simple and powerful ChatGPT-API-Server
535 stars 75 forks source link

For arm64(RPI4B) chromium is the only option #8

Open myfingerhurt opened 1 year ago

myfingerhurt commented 1 year ago

Create a debian-stable.list file containing:

deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable main
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable main

deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian-security/ stable-security main
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian-security/ stable-security main

deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable-updates main
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable-updates main

Dockerfile for arm64, not tested.

FROM node:19
WORKDIR /app

COPY debian-stable.list /etc/apt/sources.list.d/debian-stable.list
RUN apt-get install -y wget curl gnupg  \
  && apt-get update && apt-get -y install chromium xvfb \
  && alias google-chrome="chromium" \
  && echo "Chrome: " && google-chrome --version \
  && ln -s /usr/bin/chromium /usr/bin/google-chrome-stable

COPY package.json .
COPY package-lock.json .
RUN npm install
COPY . .
RUN npm run build
EXPOSE 4000
CMD npx prisma migrate deploy && xvfb-run --server-args="-screen 0 1280x800x24 -ac -nolisten tcp -dpi 96 +extension RANDR -maxclients 2048" node dist/index.js

For testing:

docker build .
docker container run --name mychatapi3 -p 4000:4000 -it --mount type=bind,source=${PWD}/data,target=/app/data mychatapi-single bash
docker commit mychatapi3 mychatapi-single:v1

The original answer is here

fuergaosi233 commented 1 year ago

Could you create a PR?