Skip to content

Commit

Permalink
build: 支持arm
Browse files Browse the repository at this point in the history
  • Loading branch information
weaigc committed Aug 30, 2023
1 parent 2e2f13b commit ca3ed5c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
# /node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
# /.next/
/out/

# production
Expand Down
45 changes: 28 additions & 17 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,34 @@ on:
- main

jobs:
github:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Login to github registry
uses: actions-hub/docker/login@master
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Build :latest
if: success()
run: docker build -t weaigc/bingo:latest .

- name: Push to docker hub :latest
if: success()
uses: actions-hub/docker@master
-
name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- run: |
npm install
npm run build
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
args: push weaigc/bingo:latest
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: weaigc/bingo:latest
4 changes: 3 additions & 1 deletion .github/workflows/huggingface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ jobs:
cd huggingface
git config user.name hf4all
git config user.email [email protected]
git commit -am "auto build" --amend
echo "Last deploy time: $(date)" > DEPLOY_INFO.txt
git add DEPLOY_INFO.txt
git commit -m "auto deploy $(date)"
git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main -f
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM node:18


ARG DEBIAN_FRONTEND=noninteractive

ENV BING_HEADER ""
Expand All @@ -18,19 +17,15 @@ USER user
# Set the working directory to the user's home directory
WORKDIR $HOME/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY --chown=user package*.json $HOME/app/

RUN npm install

# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app/

RUN npm run build && rm -rf src
#RUN npm install && npm run build

RUN rm -rf src

ENV PORT 7860

EXPOSE 7860

CMD npm start
3 changes: 2 additions & 1 deletion src/pages/api/kblob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
'x-forwarded-for': headers['x-forwarded-for'],
'user-agent': headers['User-Agent'],
cookie: headers['cookie'],
'Referer': 'https://www.bing.com/search',
Referer: 'https://www.bing.com/search?q=Bing+AI&showconv=1',
'Sec-Fetch-Dest': 'iframe',
...formData.getHeaders()
}
}
Expand Down

0 comments on commit ca3ed5c

Please sign in to comment.