tebakaja commited on
Commit
4bfd745
1 Parent(s): 4c360fd

update: fix stock reverse proxy

Browse files
.dockerignore ADDED
File without changes
.github/workflows/proxy_deploy.yaml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: deploy
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - '*'
9
+
10
+ jobs:
11
+ tebakaja_proxy_space-0:
12
+ name: Proxy Deployment
13
+ runs-on: ubuntu-latest
14
+ environment: Production
15
+
16
+ env:
17
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
18
+ SPACE_NAME: tebakaja_proxy_space-0
19
+ HF_USERNAME: qywok
20
+
21
+ steps:
22
+ - name: Set global directory
23
+ run: git config --global --add safe.directory /github/workspace
24
+
25
+ - uses: actions/checkout@v3
26
+ with:
27
+ persist-credentials: false
28
+ fetch-depth: 1000
29
+
30
+ - name: Check git status
31
+ run: git status
32
+
33
+ - name: Configure git
34
+ run: |
35
+ git config --local user.email "[email protected]"
36
+ git config --local user.name "qywok"
37
+
38
+ - name: Pull changes from remote
39
+ run: |
40
+ git pull https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main || \
41
+ (git merge --strategy-option theirs)
42
+
43
+ - name: Add and commit changes
44
+ run: |
45
+ git add -A
46
+ git diff-index --quiet HEAD || git commit -m "tebakaja_proxy_space-0"
47
+
48
+ - name: Push to Hugging Face
49
+ run: |
50
+ git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main --force
.vscode/settings.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "yaml.schemas": {
3
+ "https://json.schemastore.org/github-workflow.json": "file:///f%3A/projects/tebakaja/tebakaja_lb_proxy/.github/workflows/deploy.yaml"
4
+ }
5
+ }
Dockerfile CHANGED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # --- Build stage ---
2
+ FROM golang:1.20 as builder
3
+
4
+ LABEL creator="qywok"
5
+
6
+ WORKDIR /app
7
+
8
+ COPY go.mod go.sum ./
9
+
10
+ RUN go mod download
11
+
12
+ COPY . .
13
+
14
+ RUN go build -o main .
15
+
16
+ # --- Deploy stage ---
17
+ FROM alpine:latest
18
+
19
+ WORKDIR /app
20
+
21
+ RUN adduser -D -u 1000 user
22
+ USER user
23
+ ENV PATH="/home/user/.local/bin:$PATH"
24
+
25
+ COPY --from=builder /app/main /app/main
26
+
27
+ EXPOSE 7860
28
+
29
+ CMD ["./main"]
README.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: TebakAja Proxy Space-0
3
+ emoji: ⚙
4
+ colorFrom: purple
5
+ colorTo: pink
6
+ sdk: docker
7
+ pinned: false
8
+ ---
docker-compose.yaml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+
3
+ services:
4
+ proxy:
5
+ build:
6
+ context: .
7
+ dockerfile: Dockerfile
8
+ ports:
9
+ - "7860:7860"