Files
bakery-ia/frontend/Dockerfile.development
2025-08-03 19:23:20 +02:00

32 lines
704 B
Docker

# Development Dockerfile
FROM node:18-alpine
# Install curl for healthchecks
RUN apk add --no-cache curl
# Set working directory
WORKDIR /app
# Copy package files first (better caching)
COPY package*.json ./
# Install all dependencies (including dev dependencies)
RUN npm ci
# Copy source code
COPY . .
# Create non-root user for security
RUN addgroup -g 1001 -S nodejs
RUN adduser -S reactjs -u 1001
USER reactjs
# Expose port 3000 (Vite default)
EXPOSE 3000
# Add healthcheck
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD curl -f http://localhost:3000/ || exit 1
# Start development server with host binding
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]