Files
bookhoard/Dockerfile
T
john-okeefe 35a039d720 docs: rename INDEX files to meaningful names and fix navigation
- Renamed subdirectory INDEX.md files to section-specific names:
  - user/INDEX.md → user/user-guide.md
  - developer/INDEX.md → developer/development.md
  - operations/INDEX.md → operations/operations.md
  - contributing/INDEX.md → contributing/contributing.md
  - developer/api/INDEX.md → developer/api/api-reference.md
  - developer/api/collections/INDEX.md → developer/api/collections/collections-api.md

- Updated all internal links to use new filenames
- Updated navigation.go to skip subdirectory INDEX files from sidebar
- Added Dockerfile to include docs directory in container build

This fixes the issue where multiple 'INDEX' links appeared in the sidebar,
making navigation confusing. Now each section has a descriptive name.
2026-02-02 20:25:18 -05:00

71 lines
1.5 KiB
Docker

# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Install Node.js, npm, and curl for Tailwind CSS building
RUN apk add --no-cache nodejs npm curl
# Install sqlc
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
# Install templ
RUN go install github.com/a-h/templ/cmd/templ@latest
# Copy package files and install npm dependencies
COPY package*.json ./
RUN npm install
# Copy source code
COPY . .
# Download dependencies
RUN go mod tidy
# Generate sqlc code
RUN cd internal/database && sqlc generate
# Generate templ code
RUN cd templates && templ generate
# Build Tailwind CSS and download htmx
RUN npm run build:css:prod
RUN npm run postinstall
# Build TypeScript to JavaScript
RUN npm run build:ts
# Build the application
RUN 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 curl
# Install kepubify for EPUB→KEPUB conversion
RUN wget -O /usr/bin/kepubify https://github.com/pgaskin/kepubify/releases/latest/download/kepubify-linux-64bit \
&& chmod +x /usr/bin/kepubify
WORKDIR /root/
# Copy the binary from builder stage
COPY --from=builder /app/main .
# Copy database schema (if needed for initialization)
COPY --from=builder /app/database/schema ./database/schema
# Copy generated templates
COPY --from=builder /app/templates ./templates
# Copy web assets (HTML, CSS, JS, etc.)
COPY --from=builder /app/web ./web
# Copy documentation
COPY --from=builder /app/docs ./docs
# Expose port
EXPOSE 8765
# Run the binary
CMD ["./main"]