2024-02-16 23:21:18 +08:00
|
|
|
# syntax=docker/dockerfile:latest
|
2024-12-16 19:04:52 +08:00
|
|
|
FROM golang:1.23.4-alpine3.21 AS go
|
2023-06-06 19:43:06 +08:00
|
|
|
|
2024-12-16 20:04:39 +08:00
|
|
|
ENV IMAGINARY_HASH=8f36a26c448be8c151a3878404b75fcd1cd3cf0c
|
2023-06-06 19:43:06 +08:00
|
|
|
|
2023-04-15 18:56:14 +08:00
|
|
|
RUN set -ex; \
|
|
|
|
apk add --no-cache \
|
2023-04-06 21:05:59 +08:00
|
|
|
vips-dev \
|
2023-04-15 22:47:16 +08:00
|
|
|
vips-magick \
|
|
|
|
vips-heif \
|
2023-04-15 22:48:49 +08:00
|
|
|
vips-jxl \
|
2023-04-15 23:00:21 +08:00
|
|
|
vips-poppler \
|
2023-04-06 21:05:59 +08:00
|
|
|
build-base; \
|
2023-06-06 19:43:06 +08:00
|
|
|
go install github.com/h2non/imaginary@"$IMAGINARY_HASH";
|
2022-08-25 21:06:23 +08:00
|
|
|
|
2024-12-16 18:37:25 +08:00
|
|
|
FROM alpine:3.21.0
|
2023-04-15 18:56:14 +08:00
|
|
|
RUN set -ex; \
|
2024-04-17 23:52:42 +08:00
|
|
|
apk upgrade --no-cache -a; \
|
2023-04-15 18:56:14 +08:00
|
|
|
apk add --no-cache \
|
2023-04-06 21:05:59 +08:00
|
|
|
tzdata \
|
|
|
|
ca-certificates \
|
|
|
|
netcat-openbsd \
|
2023-04-15 22:47:16 +08:00
|
|
|
vips \
|
|
|
|
vips-magick \
|
|
|
|
vips-heif \
|
2023-04-15 23:00:21 +08:00
|
|
|
vips-jxl \
|
2024-03-04 18:48:21 +08:00
|
|
|
vips-poppler \
|
2024-07-11 21:00:33 +08:00
|
|
|
ttf-dejavu \
|
2024-03-04 18:48:21 +08:00
|
|
|
bash
|
2022-08-25 21:06:23 +08:00
|
|
|
|
2023-04-06 21:05:59 +08:00
|
|
|
COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary
|
2024-03-04 18:48:21 +08:00
|
|
|
COPY --chmod=775 start.sh /start.sh
|
2024-12-03 18:40:29 +08:00
|
|
|
COPY --chmod=775 healthcheck.sh /healthcheck.sh
|
2023-03-08 18:08:03 +08:00
|
|
|
|
2024-06-21 19:27:36 +08:00
|
|
|
ENV PORT=9000
|
2023-05-11 17:24:40 +08:00
|
|
|
|
2024-11-06 21:29:18 +08:00
|
|
|
USER 65534
|
2023-04-15 22:35:05 +08:00
|
|
|
|
2023-03-08 18:08:03 +08:00
|
|
|
# https://github.com/h2non/imaginary#memory-issues
|
|
|
|
ENV MALLOC_ARENA_MAX=2
|
2024-03-04 18:48:21 +08:00
|
|
|
ENTRYPOINT ["/start.sh"]
|
2023-04-06 21:05:59 +08:00
|
|
|
|
2024-12-03 18:40:29 +08:00
|
|
|
HEALTHCHECK CMD /healthcheck.sh
|
2023-06-26 06:56:08 +08:00
|
|
|
LABEL com.centurylinklabs.watchtower.enable="false"
|