diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..76f5fc0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM docker.io/golang:1.21 as builder +WORKDIR /app +COPY go.* ./ +RUN go mod download +COPY . ./ +RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o pixivfe + +FROM docker.io/alpine:3 +COPY --from=builder /app/pixivfe /pixivfe +COPY --from=builder /app/views /views +EXPOSE 8282 + +ENTRYPOINT ["/pixivfe"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..30c5269 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3.7" + +services: + pixivfe: + container_name: pixivfe + hostname: pixivfe + restart: always + user: 65534:65534 + read_only: true + security_opt: + - no-new-privileges:true + cap_drop: + - ALL + build: + context: . + dockerfile: Dockerfile + ports: + - "8282:8282" + environment: + # Visit https://codeberg.org/VnPower/PixivFE/wiki/Environment-variables for more details + - PIXIVFE_TOKEN=changethis + - PIXIVFE_PORT=8282 + - PIXIVFE_IMAGEPROXY=pximg.cocomi.cf