`find` seems to behave extremely weird within Docker `RUN` commands. I could not find a way to properly escape `;`s in a way that I can specify one for `find -exec` and a second one to separate `find` from the next command. `find` would always complain about it. So instead, it's now simply the last command in the chain, where no separator is needed.
59 lines
1.6 KiB
Docker
59 lines
1.6 KiB
Docker
# renovate: datasource=github-tags depName=beancount packageName=beancount/beancount
|
|
ARG BEANCOUNT_VERSION=2.3.6
|
|
# renovate: datasource=github-tags depName=fava packageName=beancount/fava
|
|
ARG FAVA_VERSION=1.28
|
|
|
|
FROM node:20.17.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;
|
|
|
|
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;
|
|
|
|
FROM python:3.12.5-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; \
|
|
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;
|
|
|
|
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 -r requirements.txt; \
|
|
pip3 uninstall -y pip; \
|
|
rm -r /app/share; \
|
|
find /app -name __pycache__ -exec rm -rf -v {} +
|
|
|
|
FROM python:3.12.5-slim
|
|
COPY --from=build_env /app /app
|
|
|
|
# Default fava port number
|
|
EXPOSE 5000
|
|
|
|
ENV BEAN_ROOT ""
|
|
ENV BEANCOUNT_FILE ""
|
|
|
|
ENV FAVA_HOST "0.0.0.0"
|
|
ENV PATH "/app/bin:$PATH"
|
|
|
|
CMD ["fava"]
|