FROM python:3.10

# Install build dependencies
RUN apt-get update && \
    apt-get install -y build-essential cmake libssl-dev curl software-properties-common

# Add the MariaDB repository
RUN curl -LsS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash

# Install MariaDB Connector/C
RUN apt-get update && \
    apt-get install -y libmariadb-dev \


WORKDIR /app/

COPY . /manager_db/
COPY .env /app/.env

WORKDIR /manager_db

RUN pip install --no-cache-dir -r requirements.txt

CMD ["gunicorn", "manager_db:app", "-c", "gunicorn.conf.py", "--certfile=server.crt", "--keyfile=server.key"]

