forked from assimon/captcha-bot
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request assimon#6 from assimon/dev
修复事件监听逻辑,将内存数据结构改为本地sqlite存储
- Loading branch information
Showing
18 changed files
with
775 additions
and
3,555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
FROM debian:bullseye-slim | ||
RUN apt-get update -y \ | ||
&& apt-get install -y libsqlite3-dev \ | ||
&& apt-get install -y sqlite3 \ | ||
&& apt-get install -y libc6 \ | ||
&& apt-get install -y libc6-dev \ | ||
&& apt-get install -y musl | ||
RUN mkdir -p /app/db | ||
ADD config.toml /app/ | ||
ADD captcha-bot /app/ | ||
ADD cacert.pem /etc/ssl/certs/ | ||
FROM golang:latest as builder | ||
|
||
WORKDIR /app | ||
ENTRYPOINT ["./captcha-bot"] | ||
|
||
COPY . . | ||
|
||
RUN apt-get update && apt-get install -y musl-tools | ||
|
||
ENV CGO_ENABLED=1 \ | ||
GOOS=linux \ | ||
GOARCH=amd64 \ | ||
CC=x86_64-linux-musl-gcc \ | ||
CXX=x86_64-linux-musl-g++ \ | ||
GOPROXY=https://goproxy.cn,direct | ||
|
||
RUN go mod download | ||
RUN go mod verify | ||
RUN go build -ldflags '-linkmode external -extldflags "-static"' -o captcha-bot | ||
|
||
FROM alpine:latest | ||
|
||
COPY --from=builder /app/captcha-bot /work/captcha-bot | ||
|
||
WORKDIR /work | ||
|
||
ENTRYPOINT ["./captcha-bot"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3.8' | ||
|
||
services: | ||
captcha-bot: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
image: captcha-bot | ||
container_name: captcha-bot | ||
volumes: | ||
- ./db:/work/db | ||
- ./config:/work/config | ||
- ./dict:/work/dict | ||
- ./runtime:/work/runtime | ||
restart: unless-stopped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.