Add dockerfile

This commit is contained in:
2026-01-23 22:34:50 +01:00
parent 0a18e19e88
commit 16ac84eaf9
2 changed files with 34 additions and 0 deletions

2
.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
sheetless.db
sheetless-server

32
Dockerfile Normal file
View File

@@ -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"]