feat(01-02): create Docker Compose dev environment with hot reload

- docker-compose.yml orchestrates backend service with Air
- Bind mount for live code editing with cached consistency
- Named volume for persistent /data storage
- .air.toml configures Go hot reload on file changes
- Targets builder stage from multi-stage Dockerfile
This commit is contained in:
acty
2026-02-03 18:11:14 +09:00
parent 257edf5c6d
commit 6cbf41410e
2 changed files with 62 additions and 0 deletions

18
docker-compose.yml Normal file
View File

@@ -0,0 +1,18 @@
services:
backend:
build:
context: .
dockerfile: docker/Dockerfile
target: builder # Stop at build stage for dev
command: air -c .air.toml
ports:
- "32768:32768"
volumes:
- .:/workspace:cached # Bind mount for live editing
- data:/data # Named volume for persistent data
working_dir: /workspace
environment:
- CGO_ENABLED=0
volumes:
data: