Add Air live‑reload tool and update the base image to golang:1.25. Configure docker‑compose with code mounts and a cached Go module volume, and switch the container command to run Air.
17 lines
317 B
YAML
17 lines
317 B
YAML
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "8080:8080"
|
|
environment:
|
|
- GO111MODULE=on
|
|
volumes:
|
|
- .:/app # Mount your code
|
|
- /app/tmp # Exclude tmp (built binaries)
|
|
- go-mod-cache:/go/pkg/mod # Cache Go modules
|
|
|
|
volumes:
|
|
go-mod-cache:
|