Files
bookhoard/backend/Dockerfile
T
john-okeefe e32fda6b65 Add user theme support and migrate frontend to HTMX templates
- Add theme column to users table with default 'tokyo-night'
- Update all user queries to include theme field
- Add ListUsers and UpdateUserTheme database queries
- Update auth handlers to support HTMX form submissions and JSON API
- Add ListUsers API endpoint
- Replace embedded static files with Go templates
- Update Dockerfile to copy templates directory
- Redesign index.html with inline styles and HTMX forms
- Update Bruno API testing requests for auth endpoints
2026-01-22 18:38:06 -05:00

43 lines
906 B
Docker

# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Install sqlc
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
# Copy backend source code
COPY backend/ ./backend/
# Download dependencies
RUN cd backend && go mod tidy
# Generate sqlc code
RUN cd backend && sqlc generate
# Copy templates (updated for new homepage)
COPY backend/templates ./backend/templates
# Build the application
RUN cd backend && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ../main ./cmd/server
# Final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
# Copy the binary from builder stage
COPY --from=builder /app/main .
# Copy migrations (if needed for initialization)
COPY --from=builder /app/backend/migrations ./migrations
# Copy templates
COPY --from=builder /app/backend/templates ./templates
# Expose port
EXPOSE 8765
# Run the binary
CMD ["./main"]