Foodster is a self-hosted dinner log and meal suggester for one household. Stage 1 (eating history) is in development; stage 2 (the suggester) follows once there is enough history to weight against. Replace the PRD's original stack (Nuxt, Postgres, Drizzle, Pico CSS) with Go 1.27, net/http, templ, Datastar and SQLite — one static binary, no Node.js in the build. Sections 3, 4, 5, 9, 10 and 11 are rewritten to match. Record the decisions made while reviewing mockups: - the UI is written in Finnish; PRD, code and comments stay English - access is one shared password over HTTP Basic rather than open on the LAN - images are CalVer vYYYYMMDD-N, built with Podman, run under Docker Compose - registry coordinates live in .env, so no infrastructure detail is committed and the MIT publication option stays open mockups/ holds standalone HTML design studies. log-fi.html is the current one; the others are superseded exploration kept for reference.
26 lines
589 B
Docker
26 lines
589 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM golang:1.27-alpine AS build
|
|
WORKDIR /src
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
ARG VERSION=dev
|
|
RUN go tool templ generate && \
|
|
CGO_ENABLED=0 GOOS=linux go build \
|
|
-trimpath \
|
|
-ldflags="-s -w -X main.version=${VERSION}" \
|
|
-o /foodster ./cmd/foodster
|
|
|
|
# Nothing but the binary. modernc.org/sqlite is pure Go, so there is no libc
|
|
# to carry along, and time/tzdata is compiled in because scratch has no
|
|
# zoneinfo.
|
|
FROM scratch
|
|
COPY --from=build /foodster /foodster
|
|
USER 65534:65534
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/foodster"]
|