Add Dockerfile, fix SQLite immutable mode, URL-encode credentials
- Dockerfile: multi-stage build with golang:1.26 and alpine + ffmpeg - SQLite: use file: URI with immutable=1 for read-only access - URL builder: encode user/pass with PathEscape/QueryEscape for special characters (@, \, :, etc.) - Health endpoint: truncate uptime to seconds - Release skill: update smoke test to /api endpoint - Remove unused ValidateID function
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
FROM golang:1.26-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache gcc musl-dev
|
||||
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
ARG VERSION=dev
|
||||
RUN CGO_ENABLED=1 go build -ldflags "-s -w -X main.version=${VERSION}" -o /strix .
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk add --no-cache ffmpeg ca-certificates
|
||||
|
||||
COPY --from=builder /strix /usr/local/bin/strix
|
||||
|
||||
WORKDIR /app
|
||||
COPY cameras.db .
|
||||
|
||||
EXPOSE 4567
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s CMD wget -q --spider http://localhost:4567/api/health || exit 1
|
||||
|
||||
USER nobody
|
||||
ENTRYPOINT ["strix"]
|
||||
Reference in New Issue
Block a user