# Production Dockerfile for Turash backend FROM golang:1.21-alpine AS builder # Set working directory WORKDIR /app # Copy go mod files COPY go.mod go.sum ./ # Download dependencies RUN go mod download # Copy source code COPY . . # Build the unified CLI application with optimizations RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bugulma-cli ./cmd/cli # Final stage FROM alpine:latest # Install ca-certificates for HTTPS requests RUN apk --no-cache add ca-certificates WORKDIR /root/ # Copy the binary from builder stage COPY --from=builder /app/bugulma-cli . # Expose port EXPOSE 8080 # Command to run the server by default CMD ["./bugulma-cli", "server"]