- Add session-based authentication system - Implement admin CRUD endpoints for properties, leads, testimonials, FAQ, services - Fix security issue: remove public GET /api/leads endpoint - Add basic input validation for leads endpoint - Add global error handler - Fix Docker healthcheck using bun's fetch - Add @types/bcrypt dependency - Add .dockerignore - Add host reboot prohibition to global rules
31 lines
769 B
Docker
31 lines
769 B
Docker
# Use Bun image
|
|
FROM oven/bun:1.1.0 AS runner
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
ENV PORT=8080
|
|
|
|
# Create data directory for SQLite
|
|
RUN mkdir -p /app/data
|
|
|
|
# Copy node_modules first (from local build)
|
|
COPY node_modules ./node_modules
|
|
|
|
# Copy source files
|
|
COPY public ./public
|
|
COPY src ./src
|
|
COPY package.json ./
|
|
COPY data ./data
|
|
|
|
# Bun has fetch built-in, use it for health check via bun command
|
|
# HEALTHCHECK will use bun's built-in fetch
|
|
|
|
# Expose port
|
|
EXPOSE 8080
|
|
|
|
# Health check using bun's built-in fetch
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD bun -e "fetch('http://localhost:8080/api/settings').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" || exit 1
|
|
|
|
# Start server
|
|
CMD ["bun", "run", "src/server/index.ts"] |