1234567891011121314151617181920212223242526272829303132333435363738 |
- FROM golang:1.22 AS builder
- WORKDIR /app
- COPY go.* ./
- RUN go mod download
- COPY . ./
- RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -ldflags="-s -w" -o pixivfe
- FROM alpine:3.19
- WORKDIR /app
- RUN addgroup -g 1000 -S pixivfe && \
- adduser -u 1000 -S pixivfe -G pixivfe && \
- chown -R pixivfe:pixivfe /app
- COPY --from=builder /app/pixivfe /app/pixivfe
- COPY --from=builder /app/assets /app/assets
- COPY ./docker/entrypoint.sh /entrypoint.sh
- RUN chmod +x /entrypoint.sh && \
- chown pixivfe:pixivfe /entrypoint.sh
- USER pixivfe
- EXPOSE 8282
- ENTRYPOINT ["/entrypoint.sh"]
- HEALTHCHECK --interval=30s --timeout=3s --start-period=15s --start-interval=5s --retries=3 \
- CMD wget --spider -q --tries=1 http://127.0.0.1:8282/about || exit 1
|