Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Sep 9, 2023
1 parent f134fc2 commit bc7e4e0
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build image

on:
workflow_dispatch:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4

-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKER_USERNAME }}/wxchat
tags: |
type=raw,value=latest
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v2

-
name: Set Up Buildx
uses: docker/setup-buildx-action@v2

-
name: Login DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

-
name: Build
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
platforms: |
linux/386
linux/amd64
linux/arm64/v8
linux/arm/v7
linux/arm/v6
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine:3.18

ENV TZ=Asia/Shanghai

RUN apk add --no-cache tzdata bash nginx && \
rm -rf /var/cache/apk/* /tmp/*

COPY --chmod=755 ./rootfs /

EXPOSE 80

ENTRYPOINT ["nginx"]
CMD ["-g" "daemon off;"]
14 changes: 14 additions & 0 deletions rootfs/app/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>

<head>
<meta charset="utf-8">
<title>微信代理</title>
</head>

<body>
<h1>微信代理搭建成功,请访问Docker对应端口</h1>


</body>

</html>
19 changes: 19 additions & 0 deletions rootfs/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
server {
listen 80;
listen [::]:80;

location / {
root /app/web;
index index.html index.htm;
}
location /cgi-bin/gettoken {
proxy_pass https://qyapi.weixin.qq.com;
}
location /cgi-bin/message/send {
proxy_pass https://qyapi.weixin.qq.com;
}
location /cgi-bin/menu/create {
proxy_pass https://qyapi.weixin.qq.com;
}

}
24 changes: 24 additions & 0 deletions rootfs/etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
user root;
worker_processes 1;

error_log /var/log/nginx/error.log;

events {
worker_connections 1024;
}

http {
server_tokens off;
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for" $request_id $msec $request_time '
'$upstream_connect_time $upstream_header_time $upstream_response_time';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
client_max_body_size 512m;
include /etc/nginx/conf.d/*.conf;
}

0 comments on commit bc7e4e0

Please sign in to comment.