# Use Python as the base image FROM python:3.12-slim # Set working directory WORKDIR /app # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install system dependencies RUN apt-get update && apt-get install -y nginx inotify-tools && rm -rf /var/lib/apt/lists/* # Copy the application code COPY . . # Create directories if they don't exist RUN mkdir -p /app/dwg_files # Copy nginx configuration COPY nginx.conf /etc/nginx/nginx.conf # Expose ports EXPOSE 80 5000 # Set permissions RUN chmod +x /app/entrypoint.sh # Use the entrypoint script instead of directly calling Gunicorn ENTRYPOINT ["/app/entrypoint.sh"]