FROM python:3.12-slim WORKDIR / # Set Python path to include app directory ENV PYTHONPATH=/ PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 # Install system dependencies and Poetry RUN apt-get update && apt-get install -y --no-install-recommends gcc && rm -rf /var/lib/apt/lists/* && pip install --no-cache-dir poetry # Copy Poetry configuration COPY /pyproject.toml ./pyproject.toml # Configure Poetry and install dependencies with optimizations RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main && pip cache purge && rm -rf ~/.cache/pypoetry # Install cron for scheduling tasks RUN apt-get update && apt-get install -y cron # Copy application code COPY /ServicesBank/Finder/BuildLivingSpace / COPY /ServicesApi/Schemas /Schemas COPY /ServicesApi/Controllers /Controllers # Create log file to grab cron logs RUN touch /var/log/cron.log # Make entrypoint script executable RUN chmod +x /entrypoint.sh RUN chmod +x /run_app.sh # Use entrypoint script to update run_app.sh with environment variables and start cron ENTRYPOINT ["/entrypoint.sh"]