Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
WangWengang committed Apr 28, 2023
1 parent 6da9b7a commit b8d572a
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
Empty file added .dockerignore
Empty file.
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM golang:alpine as builder

WORKDIR /go/src/douyin
COPY . .

RUN go env -w GO111MODULE=on \
&& go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w CGO_ENABLED=0 \
&& go env \
&& go mod tidy \
&& go build -o server .

FROM alpine:latest
LABEL MAINTAINER="wwwwangg@163.com"

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

RUN apk add --no-cache gettext tzdata curl && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
date && \
apk del tzdata


WORKDIR /go/src/server
COPY --from=0 /go/src/douyin/server ./
COPY --from=0 /go/src/douyin/certificates ./certificates

RUN cp ./certificates/proxy-ca.crt /usr/local/share/ca-certificates/proxy-ca.crt
RUN update-ca-certificates

EXPOSE 8001
ENTRYPOINT ./server
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keyc
### Fay中需将json的大写首字母改成小写
![Fay中需修改的代码](fay/fay.pic.jpg)

## 运行说明

### Docker运行
> 需要先生成证书
```bash
./certificates/generate-certificates.sh
cd ./docker
docker-compose up -d
```

### release下载可执行文件运行

> 1. [下载](https://github.com/wwengg/douyin/releases)
> 2. 生成证书
> 3. 信任证书
> 4. 打开可执行文件
> 5. 将证书发给需要代理的设备
### 感谢
- [goproxy](https://github.com/elazarl/goproxy)
Expand Down
12 changes: 12 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3"

services:
proxy:
build:
context: ../../douyin
dockerfile: ./Dockerfile
container_name: douyin-proxy
restart: always
ports:
- '8001:8001'
- '8888:8888'

0 comments on commit b8d572a

Please sign in to comment.