Add docker

This commit is contained in:
vlnst
2024-01-25 20:03:08 +03:00
parent 5a171df021
commit ea513bacca
2 changed files with 36 additions and 0 deletions
+13
View File
@@ -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"]
+23
View File
@@ -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