-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
163 additions
and
8 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 |
---|---|---|
|
@@ -25,3 +25,4 @@ go.work | |
*.db | ||
testdata | ||
*.local.yaml | ||
_output |
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
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,9 @@ | ||
server: | ||
port: 2678 | ||
database: | ||
driver: sqlite | ||
dsn: /tmp/ink.db | ||
debug: true | ||
livelog: | ||
file: | ||
dir: /tmp/ink_cache |
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,7 @@ | ||
logger: | ||
level: debug | ||
workers: | ||
- count: 1 | ||
addr: http://localhost:2678 | ||
worker: | ||
kind: docker |
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,65 @@ | ||
version: '3.8' | ||
name: ink | ||
|
||
networks: | ||
default: | ||
name: ink | ||
|
||
services: | ||
mysql57: | ||
image: mysql:5.7.31 | ||
restart: always | ||
container_name: ink_mysql57 | ||
hostname: ink_mysql57 | ||
volumes: | ||
- "~/.ink/data/mysql57:/var/lib/mysql" | ||
environment: | ||
TZ: "Asia/Shanghai" | ||
MYSQL_ROOT_PASSWORD: "123456" | ||
ports: | ||
- "3308:3306" | ||
healthcheck: | ||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", "-u", "root", "-p123456" ] | ||
interval: 10s | ||
timeout: 20s | ||
retries: 10 | ||
inkd: | ||
image: zc2638/inkd:latest | ||
restart: always | ||
container_name: inkd | ||
hostname: inkd | ||
environment: | ||
INKD_DATABASE_DRIVER: mysql | ||
INKD_DATABASE_DSN: root:123456@tcp(ink_mysql57:3306)/ink | ||
ports: | ||
- "2678:2678" | ||
depends_on: | ||
mysql57: | ||
condition: service_healthy | ||
healthcheck: | ||
test: [ "CMD", "wget", "http://localhost:2678"] | ||
interval: 5s | ||
timeout: 20s | ||
retries: 10 | ||
inker: | ||
image: zc2638/inker:latest | ||
restart: always | ||
container_name: inker | ||
hostname: inker | ||
command: | ||
- sh | ||
- -c | ||
- | | ||
cat > /work/config/inker.yaml << EOF | ||
logger: | ||
level: debug | ||
workers: | ||
- count: 1 | ||
addr: http://inkd:2678 | ||
worker: | ||
kind: docker | ||
EOF | ||
inker | ||
depends_on: | ||
inkd: | ||
condition: service_healthy |
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,26 @@ | ||
FROM golang:1.21 as builder | ||
|
||
ENV GOPROXY=https://goproxy.cn,https://goproxy.io,direct | ||
ENV CGO_ENABLED=0 | ||
|
||
WORKDIR /work | ||
ADD . . | ||
RUN make build-inker | ||
|
||
FROM alpine:3.18 as alpine | ||
|
||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \ | ||
apk update && \ | ||
apk add -U --no-cache ca-certificates tzdata | ||
|
||
FROM alpine:3.18 | ||
ENV TZ=Asia/Shanghai | ||
ENV INKD_CONFIG=/work/config/inker.yaml | ||
|
||
COPY --from=alpine /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /work/config/inker.yaml /work/config/inker.yaml | ||
COPY --from=builder /work/_output/inker /bin/inker | ||
|
||
WORKDIR /work | ||
CMD ["inkd"] |
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