Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,28 +17,14 @@ 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

# 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

Expand Down