Skip to content

Commit

Permalink
[Fix] 🤔 Use Docker Image instead of building
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed Feb 13, 2024
1 parent 651ba06 commit 7a5a795
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 39 deletions.
3 changes: 2 additions & 1 deletion .codesandbox/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"tasks": {
"cloudflared": {
"name": "cloudflared",
"command": "/app/cloudflared tunnel --no-autoupdate run --token $CF_ZERO_TRUST_TOKEN"
"command": "/app/cloudflared tunnel --no-autoupdate run --token $CF_ZERO_TRUST_TOKEN",
"runAtStart": true
}
}
}
31 changes: 8 additions & 23 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
FROM zklcdc/go-bingai-pass:latest
FROM zklcdc/go-proxy-bingai:latest-with-pass

ENV GBP_USER ${GBP_USER:-gbp}
ENV GBP_USER_ID ${GBP_USER_ID:-1000}

WORKDIR /app

USER root

RUN apt-get update && apt-get install -y --no-install-recommends curl

RUN curl -L https://github.com/Harry-zklcdc/go-proxy-bingai/releases/latest/download/go-proxy-bingai-linux-amd64.tar.gz -o go-proxy-bingai-linux-amd64.tar.gz && \
RUN wget https://github.com/Harry-zklcdc/go-proxy-bingai/releases/latest/download/go-proxy-bingai-linux-amd64.tar.gz -O go-proxy-bingai-linux-amd64.tar.gz && \
tar -zxvf go-proxy-bingai-linux-amd64.tar.gz && \
chmod +x go-proxy-bingai

RUN apt-get remove -y curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm go-proxy-bingai-linux-amd64.tar.gz
RUN wget https://github.com/Harry-zklcdc/go-bingai-pass/releases/latest/download/go-bingai-pass-linux-amd64.tar.gz -O go-bingai-pass-linux-amd64.tar.gz && \
tar -zxvf go-bingai-pass-linux-amd64.tar.gz && \
chmod +x go-bingai-pass

COPY supervisor.conf /etc/supervisor/conf.d/supervisor.conf

USER $GBP_USER
RUN rm go-bingai-pass-linux-amd64.tar.gz go-proxy-bingai-linux-amd64.tar.gz

ENV PORT=7860
ENV BYPASS_SERVER=http://localhost:8080

EXPOSE 7860 8080 9005
COPY supervisor.conf /etc/supervisor/conf.d/supervisor.conf

CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisor.conf
EXPOSE 8080 45678 9005
4 changes: 0 additions & 4 deletions .devcontainer/Dockerfile-cloudflared

This file was deleted.

4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Go Proxy BingAI",
"dockerComposeFile": "docker-compose.yml",
"service": "cloudflared",
"workspaceFolder": "/workspace"
"service": "go-proxy-bingai",
"workspaceFolder": "/app"
}
10 changes: 2 additions & 8 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ services:
build:
context: .
dockerfile: Dockerfile
no_cache: true
environment:
- HEADLESS=false
- PASS_TIMEOUT=5
ports:
- 7860:7860
- 8080:8080
- 45678:45678
- 9005:9005

cloudflared:
build:
context: .
dockerfile: Dockerfile-cloudflared
container_name: cloudflared
command: /usr/bin/cloudflared tunnel --no-autoupdate run --token $CF_ZERO_TRUST_TOKEN
2 changes: 1 addition & 1 deletion .devcontainer/supervisor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ stderr_capture_maxbytes=50MB

[program:go-bingai-pass]
command=/app/go-bingai-pass
environment=PORT=8080
environment=PORT=45678
directory=/app
stdout_logfile=/dev/stdout
stderr_logfile=/dev/stderr
Expand Down

0 comments on commit 7a5a795

Please sign in to comment.