Add hide component feature, usage indicators, and Docker support
- Add is_hidden field to hide components from configurator - Add colored dot indicator showing component usage status: - Green: available in configurator - Cyan: used as source for meta-articles - Gray: hidden from configurator - Optimize price recalculation with caching and skip unchanged - Show current lot name during price recalculation - Add Dockerfile (Alpine-based multi-stage build) - Add docker-compose.yml and .dockerignore Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
54
Dockerfile
Normal file
54
Dockerfile
Normal file
@@ -0,0 +1,54 @@
|
||||
# Build stage
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git ca-certificates tzdata
|
||||
|
||||
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 binary
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
|
||||
-ldflags="-s -w" \
|
||||
-o /app/quoteforge \
|
||||
./cmd/server
|
||||
|
||||
# Final stage
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
|
||||
# Create non-root user
|
||||
RUN adduser -D -g '' appuser
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy binary from builder
|
||||
COPY --from=builder /app/quoteforge .
|
||||
|
||||
# Copy web templates and static files
|
||||
COPY --from=builder /app/web ./web
|
||||
|
||||
# Copy migrations
|
||||
COPY --from=builder /app/migrations ./migrations
|
||||
|
||||
# Copy example config (actual config should be mounted)
|
||||
COPY --from=builder /app/config.example.yaml ./config.example.yaml
|
||||
|
||||
# Set ownership
|
||||
RUN chown -R appuser:appuser /app
|
||||
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
|
||||
|
||||
ENTRYPOINT ["/app/quoteforge"]
|
||||
Reference in New Issue
Block a user