Skip to content

Commit ca3ed5c

Browse files
committed
build: 支持arm
1 parent 2e2f13b commit ca3ed5c

File tree

5 files changed

+39
-30
lines changed

5 files changed

+39
-30
lines changed

.dockerignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
4-
/node_modules
4+
# /node_modules
55
/.pnp
66
.pnp.js
77

88
# testing
99
/coverage
1010

1111
# next.js
12-
/.next/
12+
# /.next/
1313
/out/
1414

1515
# production

.github/workflows/docker.yml

+28-17
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,34 @@ on:
66
- main
77

88
jobs:
9-
github:
9+
docker:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v1
13-
14-
- name: Login to github registry
15-
uses: actions-hub/docker/login@master
16-
env:
17-
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
18-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
19-
20-
- name: Build :latest
21-
if: success()
22-
run: docker build -t weaigc/bingo:latest .
23-
24-
- name: Push to docker hub :latest
25-
if: success()
26-
uses: actions-hub/docker@master
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v3
15+
- name: Use Node.js 18
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
- run: |
20+
npm install
21+
npm run build
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v2
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v2
26+
-
27+
name: Login to Docker Hub
28+
uses: docker/login-action@v2
29+
with:
30+
username: ${{ secrets.DOCKER_USERNAME }}
31+
password: ${{ secrets.DOCKER_PASSWORD }}
32+
-
33+
name: Build and push
34+
uses: docker/build-push-action@v4
2735
with:
28-
args: push weaigc/bingo:latest
36+
context: .
37+
platforms: linux/amd64,linux/arm64
38+
push: true
39+
tags: weaigc/bingo:latest

.github/workflows/huggingface.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ jobs:
2222
cd huggingface
2323
git config user.name hf4all
2424
git config user.email [email protected]
25-
git commit -am "auto build" --amend
25+
echo "Last deploy time: $(date)" > DEPLOY_INFO.txt
26+
git add DEPLOY_INFO.txt
27+
git commit -m "auto deploy $(date)"
2628
git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main -f

Dockerfile

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
FROM node:18
22

3-
43
ARG DEBIAN_FRONTEND=noninteractive
54

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

21-
# Install app dependencies
22-
# A wildcard is used to ensure both package.json AND package-lock.json are copied
23-
# where available (npm@5+)
24-
COPY --chown=user package*.json $HOME/app/
25-
26-
RUN npm install
27-
2820
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
2921
COPY --chown=user . $HOME/app/
3022

31-
RUN npm run build && rm -rf src
23+
#RUN npm install && npm run build
24+
25+
RUN rm -rf src
3226

3327
ENV PORT 7860
28+
3429
EXPOSE 7860
3530

3631
CMD npm start

src/pages/api/kblob.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
3535
'x-forwarded-for': headers['x-forwarded-for'],
3636
'user-agent': headers['User-Agent'],
3737
cookie: headers['cookie'],
38-
'Referer': 'https://www.bing.com/search',
38+
Referer: 'https://www.bing.com/search?q=Bing+AI&showconv=1',
39+
'Sec-Fetch-Dest': 'iframe',
3940
...formData.getHeaders()
4041
}
4142
}

0 commit comments

Comments
 (0)