From 154d8403cb205e7a32ade00b3aa5000f8f6b5516 Mon Sep 17 00:00:00 2001 From: VnPower Date: Wed, 17 Apr 2024 20:03:23 +0700 Subject: [PATCH] Add Woodpecker CI for Docker images and set default port in Dockerfile --- .woodpecker.yml | 10 ++++++++++ Dockerfile | 3 +++ doc/Environment Variables.go | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..bd1a2a3 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,10 @@ +steps: + - name: docker + image: docker + commands: + - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + - export VERSION=$(cat core/config/config.go | grep "v[0-9]\+\.[0-9]\+" -o) + - docker image build -t "vnpower/pixivfe:$VERSION" . + - docker image push "vnpower/pixivfe:$VERSION" + secrets: [ DOCKER_USERNAME, DOCKER_PASSWORD ] + diff --git a/Dockerfile b/Dockerfile index ce19cc1..92c0c99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ FROM golang:1.22 as builder WORKDIR /app +# 8282 is the default port for Docker +ENV PIXIVFE_PORT=8282 + COPY go.* ./ RUN go mod download COPY . ./ diff --git a/doc/Environment Variables.go b/doc/Environment Variables.go index 220dc63..71980bd 100644 --- a/doc/Environment Variables.go +++ b/doc/Environment Variables.go @@ -69,7 +69,7 @@ var EnvList []*EnvVar = []*EnvVar{ // **Required**: No // // Set this to a number to enable the built-in rate limiter. For example `PIXIVFE_REQUESTLIMIT=15`. - // + // // It might be better to enable rate limiting in the reverse proxy in front of PixivFE rather than using this. }, {