Skip to content

Commit

Permalink
[Add] 🎉 Docker Build
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed Nov 1, 2023
1 parent abfae45 commit 8f4ee15
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 8f4ee15

Please sign in to comment.