Instruction file imported from SamInTheShell/social (
.github/instructions/docker.instructions.md). Copyright stays with the author.
Docker Instructions
This project uses multi-stage Docker builds and Docker Compose for development and production.
Multi-Stage Build Pattern
- Node.js stage builds the frontend static assets
- Go stage builds the backend binary with embedded frontend
- Final stage uses
scratchimage for minimal production container - Frontend assets are embedded in the Go binary using
//go:embed
Development vs Production
docker-compose.deps.yml: Database and dependencies only for local developmentdocker-compose.yml: Full stack including application container- Use
make services-upfor local development with separate backend/frontend processes - Use
make compose-upfor full containerized development
Environment Variables
- All configuration is done via environment variables
- No CLI flags or config files
- See main copilot instructions for complete environment variable reference
- Database auto-initialization is enabled in Docker Compose for convenience
Container Best Practices
- Use specific image versions (not
latest) - Run as non-root user (1000:1000) in production
- Keep containers stateless
- Use scratch base image for minimal attack surface
- Embed all static assets at build time