Add Docker support and refactor data layer

This commit is contained in:
primal
2026-01-26 16:02:05 -05:00
parent 398e7b3969
commit 143807378f
12 changed files with 2642 additions and 518 deletions
+37
View File
@@ -0,0 +1,37 @@
FROM golang:1.24-alpine AS builder
WORKDIR /app
# Install build dependencies
RUN apk add --no-cache gcc musl-dev
# Copy go mod files first for layer caching
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY *.go ./
COPY static/ ./static/
# Build the binary
RUN CGO_ENABLED=1 go build -o 1440.news .
# Runtime stage
FROM alpine:latest
WORKDIR /app
# Install runtime dependencies
RUN apk add --no-cache ca-certificates tzdata
# Copy binary from builder
COPY --from=builder /app/1440.news .
COPY --from=builder /app/static ./static
# Create feeds directory
RUN mkdir -p feeds
# Expose dashboard port
EXPOSE 4321
CMD ["./1440.news"]