GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tdeemon/Dockerfile at main · tdeemon/tdeemon

Expand file tree

/

Dockerfile

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
65 lines (62 loc) · 3.13 KB
/

Dockerfile

Copy path

File metadata and controls

65 lines (62 loc) · 3.13 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# tdeemon: one static binary with the web app inside, on distroless.
#
# docker build -t tdeemon .
# docker run --read-only --stop-timeout 20 -v tdeemon-data:/data \
# -p 8080:8080 --env-file .env tdeemon
#
# docs/self-hosting.md ("Docker") has the details. The image needs no writable path
# besides /data: SQLite keeps its temporary storage in memory.
#
# The web and build stages run on the build machine's platform and Go
# cross-compiles for the target, so a multi-arch build needs no emulation.
FROM --platform=$BUILDPLATFORM docker.io/library/node:24.22.0-trixie-slim@sha256:7f486cabe892bff8fef04c0f7da8dba84a560be3e4e2740b7a86afc57ebec315 AS web
WORKDIR /src/web
COPY web/package.json web/package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci --no-audit --no-fund
COPY web/ ./
# Writes ../internal/webui/dist, which the Go build embeds.
RUN npm run build
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.27.3-trixie@sha256:1896654cfc5c2b5ad74c07f29cb36f5d2d1cbed42e3054070fbfe444e521e83c AS build
WORKDIR /src
# CI passes https://proxy.golang.org|direct, so a module the proxy fails
# to serve comes from its source; left empty, Go's default applies.
ARG GOPROXY
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod go mod download
COPY . .
COPY --from=web /src/internal/webui/dist internal/webui/dist
# The tests run against the web app this image ships, so the embed checks
# see the real build.
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go vet -tags webui ./... && go test -tags webui ./...
ARG TARGETOS TARGETARCH
ARG VERSION=dev
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -tags webui -trimpath -ldflags="-s -w -X main.version=${VERSION}" \
-o /out/tdeemon ./cmd/tdeemon \
&& mkdir /out/root && mkdir -m 0750 /out/root/data
FROM gcr.io/distroless/static-debian13:nonroot@sha256:516757106de35205efb70b91ba03f6f1298424a0678c603255cf2852a7000087
ARG VERSION=dev
LABEL org.opencontainers.image.title="tdeemon" \
org.opencontainers.image.description="Self-hosted, AI-first nutrition tracking with an adaptive TDEE" \
org.opencontainers.image.source="https://github.com/tdeemon/tdeemon" \
org.opencontainers.image.licenses="AGPL-3.0-only" \
org.opencontainers.image.version="${VERSION}"
COPY --from=build /out/tdeemon /tdeemon
# The data directory (0750) belongs to the nonroot user; an empty named
# volume mounted over it takes that ownership and mode. It is copied as an
# entry of /out/root so the mode survives. There is no VOLUME instruction
# on purpose: mount one explicitly, or with --read-only the start fails.
COPY --from=build --chown=65532:65532 /out/root/ /
ENV TDEEMON_DATA_DIR=/data
EXPOSE 8080
USER 65532:65532
# The image has no shell nor curl: the binary asks /healthz itself, at
# TDEEMON_LISTEN, without opening the database. The start period covers
# the migrations of an upgrade.
HEALTHCHECK --interval=30s --timeout=10s --start-period=2m --retries=3 \
CMD ["/tdeemon", "healthcheck"]
ENTRYPOINT ["/tdeemon"]
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.