Files
vessel/backend/Dockerfile
vikingowl a7532d7b49 feat: add install script and fix Docker environment config
- Add install.sh for one-line installation (Linux/macOS)
  - Detects local Ollama and lets user choose system vs Docker
  - Generates docker-compose.override.yml for system Ollama mode
  - Supports --update and --uninstall flags
- Fix backend not reading OLLAMA_URL from environment variable
  - Add getEnvOrDefault() helper for PORT, DB_PATH, OLLAMA_URL
  - Update Dockerfile to use env vars instead of hardcoded flags
- Update README with new Quick Start instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 08:14:39 +01:00

45 lines
878 B
Docker

FROM golang:1.24-alpine AS builder
WORKDIR /app
# Install build dependencies
RUN apk add --no-cache gcc musl-dev
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server ./cmd/server
# Final stage
FROM alpine:latest
# curl for web fetching, ca-certificates for HTTPS
RUN apk --no-cache add ca-certificates curl
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/server .
# Create data directory
RUN mkdir -p /app/data
# Expose port
EXPOSE 8080
# Set environment variables
ENV GIN_MODE=release
# Default environment variables (can be overridden in docker-compose)
ENV PORT=8080
ENV DB_PATH=/app/data/vessel.db
ENV OLLAMA_URL=http://localhost:11434
# Run the server (reads config from environment variables)
CMD ["./server"]