Spaces:
Paused
Paused
MEGAMIND Curiosity Crawler commited on
Commit ·
3e6f343
1
Parent(s): 003a967
Fix Dockerfile: add curl, remove optional copy
Browse files- Dockerfile +5 -6
Dockerfile
CHANGED
|
@@ -7,8 +7,7 @@ FROM golang:1.22-bookworm AS builder
|
|
| 7 |
WORKDIR /build
|
| 8 |
|
| 9 |
# Copy go module files first for better caching
|
| 10 |
-
COPY go.mod
|
| 11 |
-
RUN go mod download 2>/dev/null || true
|
| 12 |
|
| 13 |
# Copy source code
|
| 14 |
COPY *.go ./
|
|
@@ -23,9 +22,9 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o curiosity
|
|
| 23 |
# Stage 2: Runtime
|
| 24 |
FROM debian:bookworm-slim
|
| 25 |
|
| 26 |
-
# Install CA certificates for HTTPS
|
| 27 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 28 |
-
ca-certificates \
|
| 29 |
&& rm -rf /var/lib/apt/lists/*
|
| 30 |
|
| 31 |
# Create non-root user (HuggingFace Spaces requirement)
|
|
@@ -38,8 +37,8 @@ WORKDIR /app
|
|
| 38 |
COPY --from=builder /build/curiosity-crawler /app/curiosity-crawler
|
| 39 |
RUN chmod +x /app/curiosity-crawler
|
| 40 |
|
| 41 |
-
#
|
| 42 |
-
|
| 43 |
|
| 44 |
# Switch to non-root user
|
| 45 |
USER crawler
|
|
|
|
| 7 |
WORKDIR /build
|
| 8 |
|
| 9 |
# Copy go module files first for better caching
|
| 10 |
+
COPY go.mod ./
|
|
|
|
| 11 |
|
| 12 |
# Copy source code
|
| 13 |
COPY *.go ./
|
|
|
|
| 22 |
# Stage 2: Runtime
|
| 23 |
FROM debian:bookworm-slim
|
| 24 |
|
| 25 |
+
# Install CA certificates and curl for HTTPS and health checks
|
| 26 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 27 |
+
ca-certificates curl \
|
| 28 |
&& rm -rf /var/lib/apt/lists/*
|
| 29 |
|
| 30 |
# Create non-root user (HuggingFace Spaces requirement)
|
|
|
|
| 37 |
COPY --from=builder /build/curiosity-crawler /app/curiosity-crawler
|
| 38 |
RUN chmod +x /app/curiosity-crawler
|
| 39 |
|
| 40 |
+
# W_know will be downloaded on startup from HuggingFace dataset
|
| 41 |
+
# No need to copy it here - keeps the image small
|
| 42 |
|
| 43 |
# Switch to non-root user
|
| 44 |
USER crawler
|