feat: add Docker setup with multi-stage build and docker-compose
- Add Dockerfile with golang:1.25-alpine build stage + alpine runtime stage - Add docker-compose.yml with naviwatcher service and data volume - Add .dockerignore for build context cleanup - Add .gitignore for build artifacts and data directory - Update plan: mark Task 7 checkboxes as complete Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
# Build stage
|
||||
FROM golang:1.25-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache gcc musl-dev
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -o naviwatcher ./cmd/naviwatcher
|
||||
|
||||
# Runtime stage
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk add --no-cache ca-certificates sqlite-libs
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/naviwatcher .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
VOLUME ["/app/data"]
|
||||
|
||||
ENTRYPOINT ["./naviwatcher"]
|
||||
CMD ["-config=/app/data/config.yaml"]
|
||||
Reference in New Issue
Block a user