From f6f9f47ad84c40ffca4083a904f57ccffff75240 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Fri, 6 Dec 2024 23:13:42 +0400 Subject: [PATCH] update Dockerfile --- .dockerignore | 11 ----------- docker/Dockerfile | 27 ++++++++++++++++++--------- docker/Dockerfile.dockerignore | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+), 20 deletions(-) delete mode 100755 .dockerignore create mode 100755 docker/Dockerfile.dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100755 index ab5e8767..00000000 --- a/.dockerignore +++ /dev/null @@ -1,11 +0,0 @@ -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -*/__pycache__ -*/*.pyc \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 83663950..f4321113 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,14 +1,23 @@ -FROM python:3.11-slim-buster +FROM python:3.12 -WORKDIR pypfopt -COPY requirements.txt . +WORKDIR /pypfopt +COPY --link requirements.txt . -RUN pip install --upgrade pip \ - pip install yfinance && \ - pip install poetry \ - pip install ipython \ - pip install jupyter \ - pip install pytest \ +# prepare the system to install scs +RUN apt-get update && apt-get install -y \ + cmake \ + libopenblas-dev \ + liblapack-dev \ + && rm -rf /var/lib/apt/lists/* + + +RUN pip install --upgrade pip && \ + pip install yfinance \ + poetry \ + ipython \ + jupyter \ + ecos \ + pytest && \ pip install -r requirements.txt COPY . . diff --git a/docker/Dockerfile.dockerignore b/docker/Dockerfile.dockerignore new file mode 100755 index 00000000..266c6ab3 --- /dev/null +++ b/docker/Dockerfile.dockerignore @@ -0,0 +1,19 @@ +#https://stackoverflow.com/questions/28097064/dockerignore-ignore-everything-except-a-file-and-the-dockerfile + +# Ignore Everything +** + +# do not ignore +!docs +!cookbook +!pypfopt +!tests + +!requirements.txt +!poetry.lock +!pyproject.toml +!README.md + +# even in those folders ignore +*/__pycache__ +*/*.pyc \ No newline at end of file