From ea513bacca4db52fc9d45d788df9d695dea359c7 Mon Sep 17 00:00:00 2001 From: vlnst Date: Thu, 25 Jan 2024 20:03:08 +0300 Subject: [PATCH] Add docker --- Dockerfile | 13 +++++++++++++ docker-compose.yml | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml 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