From 16ac84eaf99b95cbcc0c154e79992a6d4f3654c3 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Fri, 23 Jan 2026 22:34:50 +0100 Subject: [PATCH] Add dockerfile --- .dockerignore | 2 ++ Dockerfile | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a53945d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +sheetless.db +sheetless-server diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d2e42ca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# Build stage +FROM golang:1.21-alpine AS builder + +WORKDIR /app + +# Copy go mod and sum files +COPY src/go.mod src/go.sum . + +# Download dependencies +RUN go mod download + +# Copy source code +COPY ./src/ . + +# Build the application +RUN go build -o sheetless-server + +# Runtime stage +FROM alpine:latest + +RUN apk --no-cache add ca-certificates + +WORKDIR /app/ + +# Copy the binary from builder +COPY --from=builder /app . + +# Expose port +EXPOSE 8080 + +# Run the application +CMD ["./sheetless-server"]