From 925028dc4b84dff3247543da342e47dc3666099a Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Fri, 23 Aug 2024 16:56:18 +0200 Subject: [PATCH] Fix Fava requirements --- images/fava/Dockerfile | 34 ++++++++++++++-------------------- images/fava/requirements.txt | 9 +++++++++ images/node-script/Dockerfile | 2 +- 3 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 images/fava/requirements.txt diff --git a/images/fava/Dockerfile b/images/fava/Dockerfile index 6c9b166..b8e38f1 100644 --- a/images/fava/Dockerfile +++ b/images/fava/Dockerfile @@ -3,52 +3,46 @@ ARG BEANCOUNT_VERSION=2.3.6 # renovate: datasource=github-tags depName=fava packageName=beancount/fava ARG FAVA_VERSION=1.27.3 -FROM node:20.17.0-slim as node_build_env +FROM node:20.11.0-slim AS node_build_env ARG FAVA_VERSION RUN set -eux; \ apt-get update; \ apt-get install -y python3-babel git make; -RUN git clone --depth 1 --branch v${FAVA_VERSION} https://github.com/beancount/fava /tmp/build/fava +RUN git clone --depth 1 --branch v${FAVA_VERSION} https://github.com/beancount/fava /tmp/build/fava; WORKDIR /tmp/build/fava RUN set -eux; \ make -j $(nproc); \ rm -rf .*cache .eggs .tox build dist frontend/node_modules; \ find . -type f -name '*.py[c0]' -delete; \ - find . -type d -name "__pycache__" -delete + find . -type d -name "__pycache__" -delete; -FROM python:3.12.3-slim as build_env +FROM python:3.12.3-slim AS build_env ARG BEANCOUNT_VERSION +ENV PATH "/app/bin:$PATH" RUN set -eux; \ apt-get update; \ - apt-get install -y build-essential libxml2-dev libxslt-dev curl git; + apt-get install -y build-essential libxml2-dev libxslt-dev curl git; \ + python -mvenv /app; -ENV PATH "/app/bin:$PATH" -RUN python -mvenv /app COPY --from=node_build_env /tmp/build/fava /tmp/build/fava -RUN git clone --depth 1 --branch ${BEANCOUNT_VERSION} https://github.com/beancount/beancount /tmp/build/beancount +RUN git clone --depth 1 --branch ${BEANCOUNT_VERSION} https://github.com/beancount/beancount /tmp/build/beancount; WORKDIR /tmp/build/beancount + +COPY requirements.txt ./ + RUN set -eux; \ CFLAGS=-s pip3 install -U /tmp/build/beancount; \ pip3 install -U /tmp/build/fava; \ - pip3 install \ - beancount-reds-plugins \ - git+https://github.com/andreasgerstmayr/fava-dashboards.git \ - git+https://github.com/beancount/beangrow.git \ - git+https://github.com/redstreet/fava_investor.git \ - git+https://github.com/daniel-wells/beancount_checkclosed.git \ - git+https://github.com/PhracturedBlue/fava-portfolio-summary.git \ - git+https://github.com/polarmutex/fava-envelope.git \ - git+https://github.com/scauligi/refried.git \ - git+https://github.com/beancount/beanprice.git@41576e2ac889e4825e4985b6f6c56aa71de28304 \ - ; \ + pip3 install -r requirements.txt; \ pip3 uninstall -y pip; \ - find /app -name __pycache__ -exec rm -rf -v {} + + find /app -name __pycache__ -exec rm -rf -v {} + \;; \ + rm -r /app/share; FROM python:3.12.3-slim COPY --from=build_env /app /app diff --git a/images/fava/requirements.txt b/images/fava/requirements.txt new file mode 100644 index 0000000..b697a65 --- /dev/null +++ b/images/fava/requirements.txt @@ -0,0 +1,9 @@ +beancount-reds-plugins==0.3.0 +beanprice==1.2.0 +fava_envelope==0.5.8 +fava-investor==0.7.0 +git+https://github.com/andreasgerstmayr/fava-dashboards.git@df40f4e2ccc6b4ec479e5146d8e62c327e44e6f9 +git+https://github.com/beancount/beangrow.git@7dd642b10a66c10ec807d9eb50fd58dc26635ba2 +git+https://github.com/daniel-wells/beancount_checkclosed.git@5abc380703105c12b518144f83a5c4fe25cc8f39 +git+https://github.com/PhracturedBlue/fava-portfolio-summary.git@fb31e371c9808a8a99ea02a60e3712271925d379 +git+https://github.com/scauligi/refried.git@b1b2a1fe1efd321142163ecc1796a38b71bb48b0 diff --git a/images/node-script/Dockerfile b/images/node-script/Dockerfile index 38f17b4..29a29c7 100644 --- a/images/node-script/Dockerfile +++ b/images/node-script/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.17.0-slim +FROM node:20.11.0-slim # renovate: datasource=npm packageName=npm versioning=npm ARG NPM_VERSION=10.5.0