Major change: I have added finance_history

* pulled old values of data via restic backups
    * inserted them into a new finance_history table
    * added a finplan user, use of sudo & better ENV (container/production) & wrapper.sh into Dockerfile (like I do for other projects)
    * recalculate the bills / Living Expenses now we have real bills for a year
    * remove tax back for now (need to handle quit date vs. end of financial year better)
    * hard-coded / hacked in 2026 for pay cycle dates / should be dynamic, but not sure I'll work in 2027+
    * refactor front-end to handle 2026 as the current year / its more or less dynamic (via hard-coded FIRST_YEAR) variable - could not use datetime, as it was in late Dec. when I noticed the issue ('next pay' was in 2026, current year was 2025)
    * also added history to graphs, changed formatting to make the history /
    * savings projections to be orannge with circles, but historical is a solid line, future is a dash, also made all lines have lineWidth: 1 for aesthetics
This commit is contained in:
2026-01-17 19:28:24 +11:00
parent 2517f8e9b9
commit e05b2c7b5b
9 changed files with 123 additions and 37 deletions

View File

@@ -3,13 +3,15 @@ FROM python:latest
# this forces /code to be owned by the user specified in the docker-compose file, we could ignore issues without this (but I am writing log files to the current dir with gunicorn as a non-priv'd user)
ARG USERID
ARG GROUPID
RUN apt-get update && apt-get install sqlite3 && apt-get dist-upgrade -y
RUN apt-get update && apt-get -y install cron sqlite3 sudo && apt-get dist-upgrade -y
WORKDIR /code
COPY requirements.txt .
RUN pip3 install -r requirements.txt
COPY crontab /etc/crontab
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt
RUN groupadd -g ${GROUPID} finplan && useradd -m -u ${USERID} -g ${GROUPID} finplan
COPY . .
RUN chown -R ${USERID}:${GROUPID} /code
EXPOSE 8080
CMD gunicorn --bind=0.0.0.0:8080 --workers=2 --threads=2 main:app --error-logfile /code/gunicorn.error.log --access-logfile /code/gunicorn.log --capture-output
# comment out the gunicorn line & uncomment the sleep so you can run gunicorn by hand in case it does not start on init (via docker exec...)
#CMD sleep 99999
RUN chown -R finplan:finplan /code
EXPOSE 80
# NOTE, wrapper.sh will use sudo to work in PROD and DEV AS the correct
# BOOK_UID/BOOK_GID as pybook user and group
CMD ["./wrapper.sh"]