FROM python:3.12-slim-bookworm

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

COPY ../service_app_init/requirements.txt .

RUN uv venv
RUN uv pip install -r requirements.txt

COPY ../service_app_init ./service_app_init

COPY ../databases ./service_app_init/databases
COPY ../api_configs ./service_app_init/api_configs
COPY ../api_events ./service_app_init/api_events
COPY ../api_library ./service_app_init/api_library
COPY ../api_validations ./service_app_init/api_validations
COPY ../api_objects ./service_app_init/api_objects
COPY ../api_services ./service_app_init/api_services
COPY ../service_app/application ./service_app_init/application
COPY ../service_app/routers ./service_app_init/routers

WORKDIR /service_app_init

CMD ["uv", "run", "runner.py"]

# Old File
#FROM python:3.10

#RUN pip install --upgrade pip
#RUN pip install --no-cache-dir --upgrade -r requirements.txt
#CMD ["python", "-m", "app"]
