- Updated docker-compose.tools.yml to mount source code at /src and set working directory for backend tools, ensuring proper Go module caching. - Modified Dockerfile.tools to install the latest golangci-lint version compatible with Go 1.24 and adjusted working directory for build-time operations. - Enhanced Makefile to build backend tools before running tests and linting, ensuring dependencies are up-to-date and improving overall workflow efficiency. - Refactored test and handler files to include error handling for database operations, enhancing reliability and debugging capabilities.
27 lines
855 B
YAML
27 lines
855 B
YAML
# 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.
|
|
# Backend: mount at /src so the image's /go module cache (from build) is not overwritten.
|
|
|
|
services:
|
|
backend-tools:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.tools
|
|
working_dir: /src
|
|
environment:
|
|
GOPATH: /go
|
|
GOMODCACHE: /go/pkg/mod
|
|
volumes:
|
|
- .:/src
|
|
# 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"]
|