From b53faf58fdff4d26d22a2d909cfe41925174580f Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 8 Oct 2026 13:57:36 -0700 Subject: [PATCH] Send only the source to Docker builds .dockerignore is now an allowlist (go.mod, go.sum, cmd, internal, web), so data, backups, .env and anything a deploy tool keeps in the project folder never go into the build context. A file changing or failing to read while the context is sent cuts the upload short, which Docker reports as "failed to read dockerfile: unexpected EOF". Also drops a stray blank first line from the Dockerfile. Co-Authored-By: Claude Opus 5.5 --- .dockerignore | 14 ++++++++++---- Dockerfile | 1 - 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index 0fd0e30..9794174 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,10 @@ -.git -data -.env -canon +# Send only what the build needs. Anything else in the project folder +# (data, backups, .env, files a deploy tool adds) stays out of the build, +# so it can't bloat the upload or change while it's being sent. +* +!go.mod +!go.sum +!cmd/ +!internal/ +!web/ +**/*_test.go diff --git a/Dockerfile b/Dockerfile index 3f86b75..ec5b0d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,3 @@ - FROM golang:1-alpine AS build WORKDIR /src COPY go.mod go.sum ./