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"]