| FROM python:3.12-slim | |
| # Install Node.js for building the frontend | |
| RUN apt-get update && apt-get install -y curl && \ | |
| curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ | |
| apt-get install -y nodejs && \ | |
| apt-get clean && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy floorplan source first and build the whl | |
| COPY floorplan/ ./floorplan/ | |
| RUN pip install gradio hatchling hatch-requirements-txt hatch-fancy-pypi-readme build && \ | |
| cd floorplan && \ | |
| pip install gradio-cli && \ | |
| gradio cc build --no-generate-docs && \ | |
| pip install dist/gradio_floorplan-0.0.1-py3-none-any.whl | |
| # Install remaining app dependencies | |
| COPY requirements.txt ./ | |
| RUN pip install google-genai python-dotenv pillow pydantic | |
| # Copy app | |
| COPY app.py ./ | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |