1# Example Dockerfile for building a Go application with the buildah engine
2# This is just an example - adjust based on your needs
3
4# Build stage
5FROM golang:1.21 AS builder
6
7WORKDIR /app
8
9# Copy go mod files
10COPY go.mod go.sum ./
11RUN go mod download
12
13# Copy source code
14COPY . .
15
16# Build the applications
17RUN mkdir -p appview/pages/static && touch appview/pages/static/x
18RUN CGO_ENABLED=1 go build -o /app/appview.out ./cmd/appview
19RUN CGO_ENABLED=1 go build -o /app/knot.out ./cmd/knot
20RUN CGO_ENABLED=1 go build -o /app/spindle.out ./cmd/spindle
21
22# Runtime stage
23FROM debian:bookworm-slim
24
25# Install runtime dependencies
26RUN apt-get update && apt-get install -y \
27 ca-certificates \
28 && rm -rf /var/lib/apt/lists/*
29
30WORKDIR /app
31
32# Copy binaries from builder
33COPY --from=builder /app/appview.out /app/appview
34COPY --from=builder /app/knot.out /app/knot
35COPY --from=builder /app/spindle.out /app/spindle
36
37# Default command
38CMD ["/app/appview"]