Coffee journaling on ATProto (alpha) alpha.arabica.social
coffee

feat: Dockerfile and compose

pdewey.com f94d1997 49490655

verified
+92
+4
BACKLOG.md
··· 31 31 32 32 - [Future work]: adjust timing of caching in feed, maybe use firehose and a sqlite database since we are only storing a few anyway 33 33 - Goal: reduce pings to server when idling 34 + 35 + - Non-authed home page feed shows different from what the firehose version shows (should be cached and show same db contents I think) 36 + 37 + - After adding a bean via add brew, that bean does not show up in the drop down until after a refresh
+50
Dockerfile
··· 1 + # Build stage 2 + FROM golang:1.25-alpine AS builder 3 + 4 + WORKDIR /app 5 + 6 + # Install build dependencies 7 + RUN apk add --no-cache git 8 + 9 + # Copy go mod files first for caching 10 + COPY go.mod go.sum ./ 11 + RUN go mod download 12 + 13 + # Copy source code 14 + COPY . . 15 + 16 + # Build the binary 17 + RUN CGO_ENABLED=0 GOOS=linux go build -o arabica cmd/server/main.go 18 + 19 + # Runtime stage 20 + FROM alpine:3.23 21 + 22 + WORKDIR /app 23 + 24 + # Install ca-certificates for HTTPS calls 25 + RUN apk add --no-cache ca-certificates 26 + 27 + # Create non-root user 28 + RUN adduser -D -u 1000 arabica 29 + 30 + # Create data directory 31 + RUN mkdir -p /data && chown arabica:arabica /data 32 + 33 + # Copy binary from builder 34 + COPY --from=builder /app/arabica . 35 + 36 + # Copy static assets and templates 37 + COPY --chown=arabica:arabica templates/ ./templates/ 38 + COPY --chown=arabica:arabica web/static/ ./web/static/ 39 + 40 + # Switch to non-root user 41 + USER arabica 42 + 43 + # Environment defaults 44 + ENV PORT=18910 45 + ENV ARABICA_DB_PATH=/data/arabica.db 46 + ENV LOG_FORMAT=json 47 + 48 + EXPOSE 18910 49 + 50 + CMD ["./arabica"]
+19
README.md
··· 22 22 23 23 Access at http://localhost:18910 24 24 25 + ## Docker 26 + 27 + ```bash 28 + # Build and run with Docker Compose 29 + docker compose up -d 30 + 31 + # Or build and run manually 32 + docker build -t arabica . 33 + docker run -p 18910:18910 -v arabica-data:/data arabica 34 + ``` 35 + 36 + For production deployments, configure environment variables in `docker-compose.yml`: 37 + 38 + ```yaml 39 + environment: 40 + - SERVER_PUBLIC_URL=https://arabica.example.com 41 + - SECURE_COOKIES=true 42 + ``` 43 + 25 44 ## Configuration 26 45 27 46 Environment variables:
+19
compose.yml
··· 1 + services: 2 + arabica: 3 + build: . 4 + ports: 5 + - "18910:18910" 6 + volumes: 7 + - arabica-data:/data 8 + environment: 9 + - PORT=18910 10 + - ARABICA_DB_PATH=/data/arabica.db 11 + - LOG_LEVEL=info 12 + - LOG_FORMAT=json 13 + # Uncomment for production behind reverse proxy: 14 + # - SERVER_PUBLIC_URL=https://arabica.example.com 15 + # - SECURE_COOKIES=true 16 + restart: unless-stopped 17 + 18 + volumes: 19 + arabica-data: