-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
873 additions
and
882 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
logs | ||
dist | ||
doc | ||
tmp | ||
node_modules | ||
.vscode | ||
.git | ||
.gitignore | ||
README.md | ||
logs | ||
dist | ||
doc | ||
tmp | ||
node_modules | ||
.vscode | ||
.git | ||
.gitignore | ||
README.md | ||
*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# API 服务使用的端口 | ||
PORT = 8787 | ||
# API 调用的前缀地址 | ||
API_PREFIX = '/' | ||
# 作为调用 API 验证的 API Key | ||
API_KEY = 'dummy_key' | ||
# 向 DDG 发送请求失败的重试次数 | ||
MAX_RETRY_COUNT = 3 | ||
# 向 DDG 发送请求失败的重试延迟,单位 ms | ||
# API 服务使用的端口 | ||
PORT = 8787 | ||
# API 调用的前缀地址 | ||
API_PREFIX = '/' | ||
# 作为调用 API 验证的 API Key | ||
API_KEY = 'dummy_key' | ||
# 向 DDG 发送请求失败的重试次数 | ||
MAX_RETRY_COUNT = 3 | ||
# 向 DDG 发送请求失败的重试延迟,单位 ms | ||
RETRY_DELAY = 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,70 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'readme.md' | ||
- 'dist/index.js' | ||
workflow_dispatch: | ||
|
||
env: | ||
GHCR_REPO: ghcr.io/leafmoes/ddg-chat | ||
DOCKER_HUB_REPO: leafmoes/ddg-chat | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Get short SHA | ||
id: slug | ||
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)" | ||
|
||
- name: Build and push to GitHub Container Registry | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.GHCR_REPO }}:latest | ||
${{ env.GHCR_REPO }}:${{ steps.slug.outputs.sha7 }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Build and push to Docker Hub | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.DOCKER_HUB_REPO }}:latest | ||
${{ env.DOCKER_HUB_REPO }}:${{ steps.slug.outputs.sha7 }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'readme.md' | ||
- 'dist/index.js' | ||
workflow_dispatch: | ||
|
||
env: | ||
GHCR_REPO: ghcr.io/leafmoes/ddg-chat | ||
DOCKER_HUB_REPO: leafmoes/ddg-chat | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Get short SHA | ||
id: slug | ||
run: echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)" | ||
|
||
- name: Build and push to GitHub Container Registry | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.GHCR_REPO }}:latest | ||
${{ env.GHCR_REPO }}:${{ steps.slug.outputs.sha7 }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Build and push to Docker Hub | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: Dockerfile | ||
push: true | ||
tags: | | ||
${{ env.DOCKER_HUB_REPO }}:latest | ||
${{ env.DOCKER_HUB_REPO }}:${{ steps.slug.outputs.sha7 }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,5 +171,5 @@ dist/README.md | |
|
||
.dev.vars | ||
.wrangler/ | ||
|
||
.vercel | ||
|
||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
FROM node:lts-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm ci --only=production | ||
|
||
COPY . . | ||
|
||
EXPOSE 8787 | ||
|
||
CMD ["npm", "start"] | ||
FROM node:lts-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm ci --only=production | ||
|
||
COPY . . | ||
|
||
EXPOSE 8787 | ||
|
||
CMD ["npm", "start"] |
Oops, something went wrong.