# docker/Dockerfile

FROM python:3.13-alpine

WORKDIR /app

RUN apk update; apk upgrade; apk add bash curl git

COPY runentrypoint.sh /usr/bin/entrypoint.sh

RUN chmod 555 /usr/bin/entrypoint.sh

# Build in the container for faster starts.
RUN python -m pip install --no-cache-dir --upgrade pip

# RUN pip install --no-cache-dir build
RUN rm -rf /app/owl

RUN git clone --depth 1 https://github.com/mdlacasse/Owl.git owl

RUN cd /app/owl && grep -vi mosek requirements.txt | python -m pip install -r /dev/stdin
# RUN cd /app/owl && python -m build
# RUN cd /app/owl && pip install --no-cache-dir .

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

ENTRYPOINT ["/bin/bash", "/usr/bin/entrypoint.sh"]
