Coffee journaling on ATProto (alpha)
alpha.arabica.social
coffee
1# Build stage
2FROM golang:1.25-alpine AS builder
3
4WORKDIR /app
5
6# Install build dependencies
7RUN apk add --no-cache git
8
9# Copy go mod files first for caching
10COPY go.mod go.sum ./
11RUN go mod download
12
13# Copy source code
14COPY . .
15
16# Build the binary
17RUN CGO_ENABLED=0 GOOS=linux go build -o arabica cmd/server/main.go
18
19# Runtime stage
20FROM alpine:3.23
21
22WORKDIR /app
23
24# Install ca-certificates for HTTPS calls
25RUN apk add --no-cache ca-certificates
26
27# Create non-root user
28RUN adduser -D -u 1000 arabica
29
30# Create data directory
31RUN mkdir -p /data && chown arabica:arabica /data
32
33# Copy binary from builder
34COPY --from=builder /app/arabica .
35
36# Copy static assets
37COPY --chown=arabica:arabica static/ ./static/
38
39# Note: Templ components are compiled into the binary, no need to copy .templ files
40
41# Switch to non-root user
42USER arabica
43
44# Environment defaults
45ENV PORT=18910
46ENV ARABICA_DB_PATH=/data/arabica.db
47ENV LOG_FORMAT=json
48
49EXPOSE 18910
50
51CMD ["./arabica"]