From 31bac38f19af7176f83bedda06a1ce7ab65b40ff Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Mon, 16 Feb 2026 11:44:02 -0600 Subject: [PATCH] fix: improve seeder Dockerfile healthcheck - Add wget installation for healthcheck - Increase healthcheck timeout to 10s - Increase start-period to 10s - Simplify to Node.js only (remove Go builder stage) --- seeder-api/Dockerfile | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/seeder-api/Dockerfile b/seeder-api/Dockerfile index b0a37c6..170882e 100644 --- a/seeder-api/Dockerfile +++ b/seeder-api/Dockerfile @@ -1,21 +1,14 @@ # ============================================================================= -# GoHorse Jobs Seeder API - Production Dockerfile (Go API + Node seeders) +# GoHorse Jobs Seeder API - Production Dockerfile (Node.js only) # ============================================================================= -FROM mirror.gcr.io/library/golang:1.22-alpine AS go-builder - -WORKDIR /src - -COPY go.mod go.sum ./ -RUN go mod download - -COPY *.go ./ -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /seeder-api - -FROM mirror.gcr.io/library/node:20-alpine +FROM node:20-alpine WORKDIR /app +# Install wget for healthcheck +RUN apk add --no-cache wget + # Install Node.js dependencies for seed scripts COPY package*.json ./ RUN npm ci --only=production && npm cache clean --force @@ -24,9 +17,6 @@ RUN npm ci --only=production && npm cache clean --force COPY src/ ./src/ COPY sql/ ./sql/ -# Copy Go API binary -COPY --from=go-builder /seeder-api /usr/local/bin/seeder-api - # Security: Run as non-root RUN addgroup -g 1001 -S nodejs && \ adduser -u 1001 -S seeder -G nodejs && \ @@ -40,8 +30,8 @@ ENV NODE_ENV=production \ EXPOSE 8080 -# Health check -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ +# Health check with longer timeout +HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ CMD wget -qO- http://localhost:8080/health || exit 1 CMD ["node", "src/server.js"]