# Development Dockerfile for Rustelo application with hot reload support FROM rust:1.75-slim-bullseye # Build arguments for feature selection (defaults for development) ARG CARGO_FEATURES="auth,content-db,crypto,email,metrics,examples" ARG NO_DEFAULT_FEATURES="false" # Install system dependencies RUN apt-get update && apt-get install -y \ pkg-config \ libssl-dev \ curl \ build-essential \ && rm -rf /var/lib/apt/lists/* # Install Node.js and npm for frontend builds RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs # Install cargo-leptos for building the application RUN cargo install cargo-leptos --version 0.2.20 # Install cargo-watch for hot reloading RUN cargo install cargo-watch # Set working directory WORKDIR /app # Copy package.json and install node dependencies COPY package.json package-lock.json* ./ RUN npm ci # Copy Cargo files COPY Cargo.toml Cargo.lock ./ COPY server/Cargo.toml ./server/ COPY client/Cargo.toml ./client/ COPY shared/Cargo.toml ./shared/ # Create app user but don't switch to it yet (for development flexibility) RUN useradd -m -u 1000 app # Create necessary directories RUN mkdir -p /app/logs /app/uploads /app/tmp /app/cache /app/data /app/backups # Change ownership to app user RUN chown -R app:app /app # Expose ports EXPOSE 3030 3031 # Set environment variables ENV RUST_LOG=debug ENV ENVIRONMENT=development ENV CARGO_FEATURES=${CARGO_FEATURES} ENV NO_DEFAULT_FEATURES=${NO_DEFAULT_FEATURES} # Default command for development with hot reload CMD ["cargo", "leptos", "watch"]