Files
calspot/Dockerfile
2026-01-11 21:50:33 +00:00

33 lines
603 B
Docker

FROM golang:alpine AS builder
# Install build tools needed for go-sqlite3 (CGO)
RUN apk add --no-cache gcc musl-dev
WORKDIR /app
# Initialize module and get dependencies
RUN go mod init calendar-service && \
go get github.com/mattn/go-sqlite3 && \
go get golang.org/x/crypto/bcrypt && \
go get golang.org/x/net/webdav && \
go get github.com/google/uuid
COPY main.go .
RUN go build -o server main.go
# Final Stage
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/server .
# Create directory for sqlite db
RUN mkdir -p data
EXPOSE 8000
# Run the server
CMD ["./server"]