From 97112d99dd9a3e79c80075c54892ca1a2ba84901 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sat, 28 Feb 2026 11:02:15 +1100 Subject: [PATCH] Added docker file --- Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..95faeea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +# Build stage +FROM golang:1.25-alpine AS builder + +WORKDIR /app + +# Copy go mod files +COPY go.mod go.sum ./ +RUN go mod download + +# Install the build dependencies +RUN apk update && \ + apk add nodejs npm make gcc libc-dev + +# Copy source code +COPY . . + +# Build the frontend +RUN make frontend + +# Build the application +RUN CGO_ENABLED=1 GOOS=linux go build -o weiro . + +# Runtime stage +FROM alpine:latest + +RUN apk --no-cache add ca-certificates +RUN mkdir -p /data + +WORKDIR /root/ + +# Copy the binary from builder +COPY --from=builder /app/weiro . +COPY --from=builder /app/static ./static +COPY --from=builder /app/views ./views + +ENV DATA_DIR=/data + +EXPOSE 3000 + +CMD ["./weiro"]