Three stages: npm build, Go build with the real dist copied over the placeholder before compiling, distroless/static (nonroot) runtime. The container listens on :8080 (all interfaces, unlike the localhost dev default). Verified locally: 16.6 MB image, /, /healthz and /api all answer. Dev loop unchanged, Docker stays out of it.
12 lines
232 B
Text
12 lines
232 B
Text
# Keep the build context small and the image layers cache-friendly:
|
|
# nothing here is needed to build the frontend or the binary.
|
|
.git
|
|
.github
|
|
docs
|
|
node_modules
|
|
web/node_modules
|
|
web/dist
|
|
web/coverage
|
|
dev.sh
|
|
Dockerfile
|
|
.dockerignore
|