-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
74 lines (59 loc) · 2.74 KB
/
Containerfile
File metadata and controls
74 lines (59 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# --------------------------------------------------------------------------
# THIS FILE IS AUTOGENERATED - DO NOT EDIT MANUALLY
#
# Source: Containerfile.j2
# --------------------------------------------------------------------------
ARG GRIMMORY_VERSION=latest
ARG BASE_VERSION=15
# --- Stage 1: Upstream Linux (Source) ---
FROM --platform=linux/amd64 ghcr.io/grimmory-tools/grimmory:${GRIMMORY_VERSION} AS upstream
# --- Stage 2: Final FreeBSD Image ---
FROM ghcr.io/daemonless/base:${BASE_VERSION}
ARG FREEBSD_ARCH=amd64
ARG PACKAGES="openjdk25-jre-headless kepubify"
ARG UPSTREAM_URL="https://api.github.com/repos/grimmory-tools/grimmory/releases/latest"
ARG UPSTREAM_JQ=".tag_name"
ARG HEALTHCHECK_ENDPOINT="http://localhost:6060/api/v1/healthcheck"
ENV HEALTHCHECK_URL="${HEALTHCHECK_ENDPOINT}"
# --- Metadata (Injected by Generator) ---
LABEL org.opencontainers.image.title="Grimmory" \
org.opencontainers.image.description="Self-hosted digital library — successor to BookLore, with smart shelves, metadata, Kobo/KOReader sync, OPDS support, and a built-in reader." \
org.opencontainers.image.source="https://github.com/daemonless/grimmory" \
org.opencontainers.image.url="https://grimmory.org/" \
org.opencontainers.image.documentation="https://grimmory.org/docs/getting-started" \
org.opencontainers.image.licenses="AGPL-3.0" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
io.daemonless.category="Media Management" \
io.daemonless.volumes="/app/data,/books,/bookdrop" \
io.daemonless.arch="${FREEBSD_ARCH}" \
io.daemonless.upstream-url="${UPSTREAM_URL}" \
io.daemonless.upstream-jq="${UPSTREAM_JQ}" \
io.daemonless.healthcheck-url="${HEALTHCHECK_ENDPOINT}"
# Install runtime dependencies
RUN pkg update && \
pkg install -y ${PACKAGES} && \
pkg clean -ay && \
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
# Copy app.jar from upstream Linux image
COPY --from=upstream /app/app.jar /app/app.jar
# Write version
RUN VERSION=$(fetch -qo - "${UPSTREAM_URL}" | sed -n 's/.*"tag_name"[^"]*"\([^"]*\)".*/\1/p' | tr -d 'v') && \
echo "$VERSION" > /app/version
# Copy service definitions
COPY root/ /
# Create directories
RUN mkdir -p /app/data /books /bookdrop /app/logs && \
chown -R bsd:bsd /app/data /books /bookdrop /app
# Make scripts executable
RUN chmod +x /etc/services.d/*/run /etc/cont-init.d/* /healthz 2>/dev/null || true
ENV GRIMMORY_PORT=6060 \
DATABASE_URL="" \
DATABASE_USERNAME="" \
DATABASE_PASSWORD="" \
SWAGGER_ENABLED="false" \
FORCE_DISABLE_OIDC="false" \
JAVA_TOOL_OPTIONS=""
# --- Expose (Injected by Generator) ---
# --- Volumes (Injected by Generator) ---
VOLUME /app/data /books /bookdrop