FROM python:slim

RUN \
    apt update && \
    apt -y upgrade && \
    apt install -y \
    gcc \
    libsasl2-dev \
    libldap2-dev \
    libssl-dev

COPY poetry.lock pyproject.toml demo/demoapp.py /opt/canaille/
RUN pip install poetry
WORKDIR /opt/canaille
RUN poetry install --with demo --without dev --extras all

ENTRYPOINT ["poetry", "run", "flask", "run", "--host=0.0.0.0", "--extra-files", "/opt/canaille/conf/canaille-memory.toml", "--extra-files", "/opt/canaille/conf/canaille-ldap.toml", "--extra-files", "/opt/canaille/conf/canaille-sql.toml"]