- Use scratch base image (< 20MB final vs ~50MB alpine) - Add BuildKit cache for go modules and build cache - Selective COPY (cmd, internal, migrations, docs) instead of COPY . . - Remove HEALTHCHECK (not supported by Podman OCI) - Update .gitignore with more binary patterns - Optimize .dockerignore to exclude tests and binaries
73 lines
939 B
Text
73 lines
939 B
Text
# =============================================================================
|
|
# GoHorse Backend - Docker Ignore (Optimized for smallest context)
|
|
# =============================================================================
|
|
|
|
# Binaries (CRITICAL - these are huge!)
|
|
/main
|
|
/api
|
|
/backend
|
|
*.exe
|
|
*.exe~
|
|
*.dll
|
|
*.so
|
|
*.dylib
|
|
*.test
|
|
/bin/
|
|
/build/
|
|
/dist/
|
|
|
|
# Tests (not needed in prod image)
|
|
*_test.go
|
|
tests/
|
|
coverage.out
|
|
coverage.html
|
|
coverage.txt
|
|
*.out
|
|
|
|
# Git
|
|
.git/
|
|
.gitignore
|
|
.gitattributes
|
|
|
|
# IDE
|
|
.idea/
|
|
.vscode/
|
|
*.swp
|
|
*.swo
|
|
*~
|
|
|
|
# Documentation (not needed in image)
|
|
*.md
|
|
!migrations/*.md
|
|
LICENSE
|
|
README*
|
|
CHANGELOG*
|
|
BACKEND.md
|
|
|
|
# Environment (security)
|
|
.env
|
|
.env.*
|
|
!.env.example
|
|
|
|
# Temp and logs
|
|
tmp/
|
|
temp/
|
|
*.tmp
|
|
*.log
|
|
__debug_bin*
|
|
|
|
# OS
|
|
.DS_Store
|
|
Thumbs.db
|
|
|
|
# Docker
|
|
Dockerfile*
|
|
docker-compose*
|
|
.dockerignore
|
|
|
|
# Go debug/cache (if present)
|
|
go.work
|
|
go.work.sum
|
|
|
|
# Swagger docs source (built at runtime if needed)
|
|
# Keep docs/ for swagger.json
|