Files
hive/frontend/Dockerfile
anthonyrawlins 962fbbd4b5 Fix Hive frontend and backend service issues
Backend fixes:
- Remove --reload flag to prevent dev mode cycling
- Add curl for health checks
- Configure PostgreSQL connection properly
- Fix Docker CMD for production deployment

Frontend fixes:
- Use serve for production static file serving
- Add curl for health checks (installed as root before user switch)
- Configure proper host binding for containers
- Fix Dockerfile layer ordering

Results:
-  Backend: 1/2 replicas running, health checks passing
-  Frontend: 2/2 replicas running, serving requests
-  Health endpoints responding correctly
-  Services stable and persistent

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 22:24:29 +10:00

36 lines
725 B
Docker

FROM node:18-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies (including dev deps for build)
RUN npm install && npm install -g serve
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Install curl for health checks (as root)
RUN apk add --no-cache curl
# Create non-root user
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
# Change ownership
RUN chown -R nextjs:nodejs /app
USER nextjs
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3000 || exit 1
# Start the application using serve for production
CMD ["serve", "-s", "dist", "-l", "3000"]