FROM golang:1.21-alpine # Install build dependencies RUN apk add --no-cache gcc musl-dev sqlite-dev WORKDIR /app # Copy go mod files first for better caching COPY go.mod go.sum ./ RUN go mod download # Copy source code COPY . . # Build the application RUN CGO_ENABLED=1 go build -o /todo-app # Install Ollama for AI analysis RUN wget https://ollama.ai/install.sh -O install.sh && \ chmod +x install.sh && \ ./install.sh # Create volume for persistent data VOLUME /data # Set environment variables ENV DB_PATH=/data/todoai.db \ AI_MODEL_NAME=deepseek-r1:latest \ AI_PROVIDER=ollama # Expose port if needed for future API/web interface EXPOSE 8080 CMD ["/todo-app"]