# Use Ubuntu as base image for better Docker-in-Docker support FROM ubuntu:22.04 # Avoid prompts from apt ENV DEBIAN_FRONTEND=noninteractive # Install system dependencies including Docker RUN apt-get update && apt-get install -y \ curl \ wget \ gnupg \ lsb-release \ ca-certificates \ apt-transport-https \ software-properties-common \ supervisor \ nginx \ iptables \ && rm -rf /var/lib/apt/lists/* # Install Docker Engine for Docker-in-Docker RUN mkdir -p /etc/apt/keyrings \ && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \ && apt-get update \ && apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \ && rm -rf /var/lib/apt/lists/* # Install Node.js 18.x RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs # Create app directory WORKDIR /app # Copy package files COPY package*.json ./ COPY client/package*.json ./client/ # Install dependencies (include devDependencies for build and nodemon) RUN npm install --include=dev RUN cd client && npm install --include=dev # Copy application code COPY . . # Build frontend RUN cd client && npm run build # Copy nginx configuration COPY nginx.conf /etc/nginx/nginx.conf # Create supervisor configuration RUN mkdir -p /var/log/supervisor COPY <