FROM python:3.11-slim WORKDIR /usr/src/app # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code and .env COPY postgresql.py . COPY .env . # Server configuration (defaults) ENV SERVER_HOST="0.0.0.0" ENV BACKEND_PORT="8002" ENV FRONTEND_PORT="7860" ENV GRADIO_SERVER_NAME="0.0.0.0" EXPOSE ${FRONTEND_PORT} CMD ["python", "postgresql.py"]