FROM python:3.14-alpine # Install system dependencies RUN apk add --no-cache \ hostapd \ sudo # Create app directory WORKDIR /app # Copy requirements and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create non-root user for security RUN adduser -D -u 1000 appuser && \ chown -R appuser:appuser /app && \ echo "appuser ALL=(ALL) NOPASSWD: /usr/bin/hostapd_cli" >> /etc/sudoers USER appuser # Expose port EXPOSE 5000 # Run application CMD ["python", "app.py"]