64 lines
1014 B
YAML
64 lines
1014 B
YAML
x-go: &go
|
|
image: golang:${GO_VERSION:-1.27.1}
|
|
working_dir: /app
|
|
volumes:
|
|
- .:/app
|
|
- gocache:/cache
|
|
environment:
|
|
HOME: /cache
|
|
GOCACHE: /cache/build
|
|
GOMODCACHE: /cache/mod
|
|
REPIN: ${REPIN:-}
|
|
|
|
services:
|
|
test:
|
|
<<: *go
|
|
command: go test -race ./...
|
|
|
|
cover:
|
|
<<: *go
|
|
command: go test -cover ./...
|
|
|
|
bench:
|
|
<<: *go
|
|
command: go test -run XXX -bench . -benchmem ./...
|
|
|
|
generate:
|
|
<<: *go
|
|
command: go generate ./...
|
|
|
|
vet:
|
|
<<: *go
|
|
command: go vet ./...
|
|
|
|
cyclo:
|
|
<<: *go
|
|
command: go run github.com/fzipp/gocyclo/cmd/gocyclo@v0.6.0 -over 14 -ignore _test .
|
|
|
|
build:
|
|
<<: *go
|
|
command: go build ./...
|
|
|
|
fmt:
|
|
<<: *go
|
|
command: gofmt -w .
|
|
|
|
tidy:
|
|
<<: *go
|
|
command: go mod tidy
|
|
|
|
# Interactive shell for ad-hoc work: docker compose run --rm dev
|
|
dev:
|
|
<<: *go
|
|
command: sh
|
|
|
|
data-import:
|
|
image: python:3.14.7-slim
|
|
working_dir: /app
|
|
volumes:
|
|
- .:/app
|
|
entrypoint: python3
|
|
|
|
volumes:
|
|
gocache:
|