Enhance development workflow with Docker integration
- Updated CONTRIBUTING.md to clarify the use of Makefile targets for running tasks inside Docker, eliminating the need for local Go or Node installations. - Introduced docker-compose.tools.yml for backend and frontend tools, allowing for streamlined testing, linting, and formatting. - Created Dockerfile.tools to set up a Go environment with necessary tools for testing and linting. - Modified Makefile to include separate targets for backend and frontend tests, improving clarity and usability. - Updated documentation in development.md and testing.md to reflect the new Docker-based workflow for running tests and development tasks.
This commit is contained in:
21
docker-compose.tools.yml
Normal file
21
docker-compose.tools.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
# One-off tools: test, lint, fmt. Use with: docker compose -f docker-compose.tools.yml run --rm <service> <cmd>
|
||||
# Source is mounted so commands run against current code.
|
||||
|
||||
services:
|
||||
backend-tools:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.tools
|
||||
volumes:
|
||||
- .:/hnh-map
|
||||
# Default command; override when running (e.g. go test ./..., golangci-lint run).
|
||||
command: ["go", "test", "./..."]
|
||||
|
||||
frontend-tools:
|
||||
image: node:20-alpine
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./frontend-nuxt:/app
|
||||
- /app/node_modules
|
||||
# Default command; override when running (e.g. npm test, npm run lint).
|
||||
command: ["npm", "test"]
|
||||
Reference in New Issue
Block a user