diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml new file mode 100644 index 0000000..f97c45a --- /dev/null +++ b/.github/workflows/docker_build.yml @@ -0,0 +1,43 @@ +name: Build Go-Proxy-BingAI +on: + workflow_dispatch: + repository_dispatch: + types: + - Build_Docker + +jobs: + docker-build: + name: docker-build + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v3 + + - name: Setup timezone + uses: zcong1993/setup-timezone@master + with: + timezone: Asia/Shanghai + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v4 + with: + platforms: linux/amd64 + context: . + file: ./Dockerfile + push: true + tags: | + docker.io/zklcdc/go-bingai-pass:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1c73e88 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:22.04 + +WORKDIR /app + +RUN apt-get update && apt-get install -y wget curl && \ + wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ + apt install -y ./google-chrome-stable_current_amd64.deb && \ + curl -L $(curl -s https://api.github.com/repos/Harry-zklcdc/go-bingai-pass/releases/latest | grep /go-bingai-pass-linux-amd64.tar.gz | cut -d '"' -f 4) -o go-bingai-pass-linux-amd64.tar.gz && \ + tar -zxvf go-bingai-pass-linux-amd64.tar.gz && \ + chmod +x go-bingai-pass && \ + rm google-chrome-stable_current_amd64.deb go-bingai-pass-linux-amd64.tar.gz && \ + apt clean && \ + rm -rf /var/lib/apt/lists/* + +ENV PORT=8080 +ENV BROWSER_BINARY=/opt/google/chrome/google-chrome +ENV PASS_TIMEOUT=10 + +EXPOSE 8080 + +CMD ["/app/go-bingai-pass"] \ No newline at end of file