mqtt
Some checks failed
CI / Test (1.22) (push) Failing after -23m51s
CI / Test (1.23) (push) Failing after -23m51s
CI / Lint (push) Has been cancelled
CI / Build (push) Has been cancelled
Release / Build and Release (push) Successful in -18m25s

This commit is contained in:
2025-12-29 23:36:22 +02:00
parent fd2527219e
commit ea1209c84c
14 changed files with 864 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.23-alpine AS builder
FROM golang:1.25-alpine AS builder
# Install build dependencies (SQLite requires CGO)
RUN apk add --no-cache gcc musl-dev sqlite-dev
@@ -13,9 +13,11 @@ RUN go mod download
# Copy source code
COPY . .
# Build the server binary
# Build the binaries
# CGO is required for mattn/go-sqlite3
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o whatshooked-server ./cmd/server
RUN mkdir -p bin && \
CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o bin/whatshook-server ./cmd/server && \
CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o bin/whatshook-cli ./cmd/cli
# Runtime stage
FROM alpine:latest
@@ -25,15 +27,15 @@ RUN apk add --no-cache ca-certificates sqlite-libs tzdata
WORKDIR /app
# Copy binary from builder
COPY --from=builder /build/whatshooked-server .
# Copy binaries from builder
COPY --from=builder /build/bin ./bin
# Create necessary directories
RUN mkdir -p /app/sessions /app/data/media
RUN mkdir -p /app/sessions /app/data/media /app/data/certs
# Expose the default server port
EXPOSE 8080
# Run the server
ENTRYPOINT ["/app/whatshooked-server"]
ENTRYPOINT ["/app/bin/whatshook-server"]
CMD ["-config", "/app/config.json"]