diff --git a/Dockerfile b/Dockerfile index bf2b1ec..279729f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Multi-stage build for optimal image size -FROM golang:1.24.1-alpine AS builder +FROM golang:1.25.5-alpine AS builder # Set working directory WORKDIR /app @@ -17,14 +17,7 @@ COPY *.go ./ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o wotrlay . # Final stage: minimal runtime image -FROM alpine:3.20 - -# Install ca-certificates for HTTPS requests -RUN apk --no-cache add ca-certificates - -# Create non-root user -RUN addgroup -g 1001 -S appgroup && \ - adduser -u 1001 -S appuser -G appgroup +FROM scratch # Set working directory WORKDIR /app @@ -32,13 +25,6 @@ WORKDIR /app # Copy binary from builder stage COPY --from=builder /app/wotrlay . -# Create data directory for Badger DB (will be in /app/badger due to WORKDIR) -RUN mkdir -p /app/badger && \ - chown -R appuser:appgroup /app/badger - -# Switch to non-root user -USER appuser - # Expose port EXPOSE 3334