-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
97 lines (78 loc) · 3.72 KB
/
Containerfile
File metadata and controls
97 lines (78 loc) · 3.72 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# --------------------------------------------------------------------------
# THIS FILE IS AUTOGENERATED - DO NOT EDIT MANUALLY
#
# Source: Containerfile.j2
# --------------------------------------------------------------------------
# Uptime Kuma - Self-hosted monitoring tool
# Multi-stage build: compile with npm, run with node + chromium
ARG BASE_VERSION=15
FROM ghcr.io/daemonless/base:${BASE_VERSION} AS builder
# Build dependencies (including C compiler for native modules like sqlite3)
RUN pkg update && pkg install -y \
node22 npm-node22 git-lite python311 \
gmake pkgconf sqlite3 FreeBSD-clang FreeBSD-toolchain FreeBSD-clibs-dev \
&& pkg clean -ay
# Get latest release version
ARG UPTIME_KUMA_VERSION=""
RUN if [ -z "${UPTIME_KUMA_VERSION}" ]; then \
UPTIME_KUMA_VERSION=$(fetch -qo - "https://api.github.com/repos/louislam/uptime-kuma/releases/latest" | jq -r '.tag_name'); \
fi && \
echo "Building Uptime Kuma ${UPTIME_KUMA_VERSION}" && \
git clone --depth 1 --branch "${UPTIME_KUMA_VERSION}" \
https://github.com/louislam/uptime-kuma.git /app/uptime-kuma && \
echo "${UPTIME_KUMA_VERSION}" > /app/version
WORKDIR /app/uptime-kuma
# Install and build (skip git checkout from npm run setup - we already have the right version)
RUN npm ci --omit dev && npm run download-dist
# Patch Playwright for FreeBSD compatibility
RUN sed -i '' "s/process.platform === 'linux'/process.platform === 'freebsd'/" \
node_modules/playwright-core/lib/server/registry/index.js
# Production image
FROM ghcr.io/daemonless/base:${BASE_VERSION}
ARG FREEBSD_ARCH=amd64
ARG PACKAGES="node22 chromium"
ARG UPSTREAM_URL="https://api.github.com/repos/louislam/uptime-kuma/releases/latest"
ARG UPSTREAM_JQ=".tag_name"
ARG HEALTHCHECK_ENDPOINT="http://localhost:3001/api/entry-page"
ENV HEALTHCHECK_URL="${HEALTHCHECK_ENDPOINT}"
# --- Metadata (Injected by Generator) ---
LABEL org.opencontainers.image.title="Uptime Kuma" \
org.opencontainers.image.description="Self-hosted uptime monitoring tool with a beautiful dashboard, status pages, and multi-channel notifications." \
org.opencontainers.image.source="https://github.com/daemonless/uptime-kuma" \
org.opencontainers.image.url="https://uptime.kuma.pet/" \
org.opencontainers.image.documentation="https://github.com/louislam/uptime-kuma/wiki" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
io.daemonless.category="Utilities" \
io.daemonless.port="3001" \
io.daemonless.volumes="/config" \
io.daemonless.arch="${FREEBSD_ARCH}" \
io.daemonless.upstream-url="${UPSTREAM_URL}" \
io.daemonless.upstream-jq="${UPSTREAM_JQ}" \
io.daemonless.healthcheck-url="${HEALTHCHECK_ENDPOINT}" \
io.daemonless.packages="${PACKAGES}"
# Runtime dependencies
RUN pkg update && \
pkg install -y ${PACKAGES} && \
pkg clean -ay && \
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
# Create chromium symlink for Uptime Kuma compatibility
RUN ln -sf /usr/local/bin/chrome /usr/bin/chromium || true
# Copy built application from builder (with correct ownership)
COPY --from=builder --chown=bsd:bsd /app/uptime-kuma /app/uptime-kuma
COPY --from=builder --chown=bsd:bsd /app/version /app/version
# Create directories
RUN mkdir -p /config && chown bsd:bsd /config
# Copy service files
COPY root/ /
RUN chmod +x /etc/services.d/*/run /etc/cont-init.d/* 2>/dev/null || true
# Environment for Chromium support
ENV UPTIME_KUMA_IS_CONTAINER=1
ENV UPTIME_KUMA_ALLOW_ALL_CHROME_EXEC=1
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ENV DATA_DIR=/config
# --- Expose (Injected by Generator) ---
EXPOSE 3001
# --- Volumes (Injected by Generator) ---
VOLUME /config