forked from EvergreenCrypto/docker-finance
client: docker: complete build overhaul, optimize
This commit brings a complete overhaul of the build system:
- Creates a separation of concerns for 'local' and 'remote' building
* 'local' is built locally via the docker-finance `build` command
* 'remote' is built *outside* of the docker-finance `build` command
(pushed to a remote registry and then pulled by the 'local' build)
* Related refactoring
- Dockerfiles
- `lib_gen`
- Adds remote image 'hledger-suite'
* Provides the latest versions of all `hledger` related binaries
* No longer relies on package maintainers / out-dated packages
- Adds remote image 'docker-finance'
* Provides base image for 'finance' and 'dev-tools' images
- tags 'archlinux' | 'ubuntu' | 'dev-tools'
- Removes previous `hledger` related build modules
* Removes building any `hledger` related binaries locally
- Removes 'experimental' build
* End-user can use local custom Dockerfile and/or custom tag instead
- Updates the 'default' | 'slim' | 'tiny' | 'micro' build types
* Refactors build type requirements into separate build modules
- Adds 'fetch' module
- Adds 'track' module
- Adds 'user' module
* creates container user *after* base and all other modules
* allows for quick re-building across multiple local users
- Updates 'root' module
* `lib_docker`
- Updates usage help
- Adds build modules per build type
- Huge optimizations
* Vastly improves build times
- ~60% faster w/ a fresh build
- ~60%-90% faster rebuild (depending on image type)
* Vastly improves image sizes
- e.g., 'default' Arch Linux image size is ~50% smaller
This commit is contained in:
21
client/Dockerfiles/local/dev-tools/Dockerfile.dev-tools.in
Normal file
21
client/Dockerfiles/local/dev-tools/Dockerfile.dev-tools.in
Normal file
@@ -0,0 +1,21 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# https://hub.docker.com/evergreencrypto/docker-finance
|
||||
FROM evergreencrypto/docker-finance:dev-tools
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
@@ -0,0 +1,57 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
services:
|
||||
docker-finance:
|
||||
image: @DOCKER_FINANCE_IMAGE@
|
||||
container_name: @DOCKER_FINANCE_CONTAINER@
|
||||
build: .
|
||||
volumes:
|
||||
#
|
||||
# NOTE: using DOCKER_FINANCE_CLIENT_REPO on both ends because:
|
||||
#
|
||||
# 1. Linter requires a transparent bind-mount from the client
|
||||
# 2. There's no use-case for custom container configurations
|
||||
#
|
||||
- ${DOCKER_FINANCE_CLIENT_REPO}/docker-finance.dox:${DOCKER_FINANCE_CLIENT_REPO}/docker-finance.dox
|
||||
- ${DOCKER_FINANCE_CLIENT_REPO}/client:${DOCKER_FINANCE_CLIENT_REPO}/client
|
||||
- ${DOCKER_FINANCE_CLIENT_REPO}/container:${DOCKER_FINANCE_CLIENT_REPO}/container
|
||||
- ${DOCKER_FINANCE_CLIENT_PLUGINS}/client:${DOCKER_FINANCE_CLIENT_PLUGINS}/client
|
||||
- ${DOCKER_FINANCE_CLIENT_PLUGINS}/container:${DOCKER_FINANCE_CLIENT_PLUGINS}/container
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- DOCKER_FINANCE_VERSION=@DOCKER_FINANCE_VERSION@
|
||||
- DOCKER_FINANCE_CLIENT_REPO=${DOCKER_FINANCE_CLIENT_REPO}
|
||||
- DOCKER_FINANCE_CLIENT_PLUGINS=${DOCKER_FINANCE_CLIENT_PLUGINS}
|
||||
- GID=${DOCKER_FINANCE_GID}
|
||||
- UID=${DOCKER_FINANCE_UID}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: ${DOCKER_FINANCE_CPUS}
|
||||
memory: ${DOCKER_FINANCE_MEMORY}
|
||||
restart: on-failure
|
||||
init: true
|
||||
networks:
|
||||
docker-finance:
|
||||
|
||||
networks:
|
||||
docker-finance:
|
||||
external: true
|
||||
name: @DOCKER_FINANCE_NETWORK@
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
30
client/Dockerfiles/local/dev-tools/ubuntu/Dockerfile.user.in
Normal file
30
client/Dockerfiles/local/dev-tools/ubuntu/Dockerfile.user.in
Normal file
@@ -0,0 +1,30 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'user' module
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
# Remove default 'ubuntu' user which may conflict with host user's UID/GID (1000:1000)
|
||||
RUN userdel -r ubuntu
|
||||
|
||||
# Add 'dev-tools' user
|
||||
RUN useradd -m -s /bin/bash @DOCKER_FINANCE_USER@ -u @DOCKER_FINANCE_UID@
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
21
client/Dockerfiles/local/finance/Dockerfile.archlinux.in
Normal file
21
client/Dockerfiles/local/finance/Dockerfile.archlinux.in
Normal file
@@ -0,0 +1,21 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# https://hub.docker.com/evergreencrypto/docker-finance
|
||||
FROM evergreencrypto/docker-finance:archlinux
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
21
client/Dockerfiles/local/finance/Dockerfile.ubuntu.in
Normal file
21
client/Dockerfiles/local/finance/Dockerfile.ubuntu.in
Normal file
@@ -0,0 +1,21 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# https://hub.docker.com/evergreencrypto/docker-finance
|
||||
FROM evergreencrypto/docker-finance:ubuntu
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
@@ -0,0 +1,46 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'fetch' module
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
RUN pacman -Syu \
|
||||
composer \
|
||||
proxychains-ng \
|
||||
--noconfirm --disable-download-timeout
|
||||
|
||||
RUN sed -i \
|
||||
-e 's:^;extension=bcmath:extension=bcmath:' \
|
||||
-e 's:^;extension=gmp:extension=gmp:' \
|
||||
-e 's:^;extension=iconv:extension=iconv:' \
|
||||
/etc/php/php.ini
|
||||
|
||||
# Add builder user for `composer`
|
||||
RUN useradd -m -s /bin/bash -r builder
|
||||
|
||||
USER builder
|
||||
WORKDIR /usr/local/lib/php
|
||||
|
||||
RUN composer require -n ozdemirburak/json-csv
|
||||
RUN composer require -n ccxt/ccxt
|
||||
# "Sunsetted" Coinbase Pro
|
||||
#RUN composer require mocking-magician/coinbase-pro-sdk
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
@@ -0,0 +1,38 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'root' module
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
# ROOT.cern
|
||||
RUN pacman -Syu \
|
||||
root \
|
||||
--noconfirm --disable-download-timeout
|
||||
|
||||
# docker-finance
|
||||
RUN pacman -Syu \
|
||||
benchmark \
|
||||
botan2 \
|
||||
crypto++ \
|
||||
gtest \
|
||||
libsodium \
|
||||
--noconfirm --disable-download-timeout
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
@@ -0,0 +1,30 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'track' module
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
RUN pacman -Syu \
|
||||
git \
|
||||
timew \
|
||||
visidata \
|
||||
--noconfirm --disable-download-timeout
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
@@ -0,0 +1,30 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'user' module
|
||||
#
|
||||
|
||||
# Add 'finance' user
|
||||
USER root
|
||||
RUN useradd -m -s /bin/bash @DOCKER_FINANCE_USER@ -u @DOCKER_FINANCE_UID@
|
||||
|
||||
USER @DOCKER_FINANCE_USER@
|
||||
RUN echo "source \"\${DOCKER_FINANCE_CONTAINER_CONF}/shell/superscript.bash\"" >>~/.bashrc
|
||||
RUN echo "source \"\${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/completion.bash\"" >>~/.bashrc
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
@@ -0,0 +1,78 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
services:
|
||||
docker-finance:
|
||||
image: @DOCKER_FINANCE_IMAGE@
|
||||
container_name: @DOCKER_FINANCE_CONTAINER@
|
||||
build: .
|
||||
# NOTE: env bind mounts are used exclusively because volumes should be
|
||||
# reserved for persistant data that the *container* generates/needs.
|
||||
# In docker-finance, the container and client (host) are largely transparent
|
||||
# and treated as one (and dangling volumes are not desired).
|
||||
volumes:
|
||||
- ${DOCKER_FINANCE_CLIENT_CONF}/container:${DOCKER_FINANCE_CONTAINER_CONF}
|
||||
- ${DOCKER_FINANCE_CLIENT_FLOW}:${DOCKER_FINANCE_CONTAINER_FLOW}
|
||||
# Connects client-side (host) custom container plugins (not repo's container plugins)
|
||||
- ${DOCKER_FINANCE_CLIENT_PLUGINS}/container:${DOCKER_FINANCE_CONTAINER_PLUGINS}:ro
|
||||
- ${DOCKER_FINANCE_CLIENT_REPO}/container:${DOCKER_FINANCE_CONTAINER_REPO}:ro
|
||||
- ${DOCKER_FINANCE_CLIENT_SHARED}:${DOCKER_FINANCE_CONTAINER_SHARED}
|
||||
# Needed for when upstream data is localtime instead of UTC
|
||||
# NOTE: although TZ can be used within the container, this *should* be more dynamic
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- DOCKER_FINANCE_CONTAINER_CMD=${DOCKER_FINANCE_CONTAINER_CMD}
|
||||
- DOCKER_FINANCE_CONTAINER_CONF=${DOCKER_FINANCE_CONTAINER_CONF}
|
||||
- DOCKER_FINANCE_CONTAINER_EDITOR=${DOCKER_FINANCE_CONTAINER_EDITOR}
|
||||
- DOCKER_FINANCE_CONTAINER_FLOW=${DOCKER_FINANCE_CONTAINER_FLOW}
|
||||
- DOCKER_FINANCE_CONTAINER_PLUGINS=${DOCKER_FINANCE_CONTAINER_PLUGINS}
|
||||
- DOCKER_FINANCE_CONTAINER_REPO=${DOCKER_FINANCE_CONTAINER_REPO}
|
||||
- DOCKER_FINANCE_CONTAINER_SHARED=${DOCKER_FINANCE_CONTAINER_SHARED}
|
||||
- DOCKER_FINANCE_DEBUG=${DOCKER_FINANCE_DEBUG}
|
||||
- DOCKER_FINANCE_VERSION=@DOCKER_FINANCE_VERSION@
|
||||
- GID=${DOCKER_FINANCE_GID}
|
||||
- UID=${DOCKER_FINANCE_UID}
|
||||
# Container's view of client's hledger-flow (for logging purposes)
|
||||
- DOCKER_FINANCE_CLIENT_FLOW=${DOCKER_FINANCE_CLIENT_FLOW}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: ${DOCKER_FINANCE_CPUS}
|
||||
memory: ${DOCKER_FINANCE_MEMORY}
|
||||
# TODO: As of `archlinux v20240201.0.210909 (docker image)` (or later) and
|
||||
# `hledger 1.32.1` (or later), "get_mempolicy: Operation not permitted"
|
||||
# is spammed w/ every hledger command (hledger / hledger-*). I don't know
|
||||
# if this is a haskell-build issue or a hledger/hledger dependency issue but
|
||||
# the error is only reproducible inside a docker container when issuing
|
||||
# hledger commands. Adding SYS_NICE here removes the error spam but it's
|
||||
# otherwise not a capability that's needed (so, resolve this upstream).
|
||||
cap_add:
|
||||
- SYS_NICE
|
||||
restart: no
|
||||
init: true
|
||||
networks:
|
||||
docker-finance:
|
||||
ports:
|
||||
- ${DOCKER_FINANCE_PORT_HLEDGER}:5000
|
||||
- ${DOCKER_FINANCE_PORT_ROOT}:8080
|
||||
|
||||
networks:
|
||||
docker-finance:
|
||||
external: true
|
||||
name: @DOCKER_FINANCE_NETWORK@
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
@@ -0,0 +1,69 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
services:
|
||||
docker-finance:
|
||||
image: @DOCKER_FINANCE_IMAGE@
|
||||
container_name: @DOCKER_FINANCE_CONTAINER@
|
||||
build: .
|
||||
# NOTE: env bind mounts are used exclusively because volumes should be
|
||||
# reserved for persistant data that the *container* generates/needs.
|
||||
# In docker-finance, the container and client (host) are largely transparent
|
||||
# and treated as one (and dangling volumes are not desired).
|
||||
volumes:
|
||||
- ${DOCKER_FINANCE_CLIENT_CONF}/container:${DOCKER_FINANCE_CONTAINER_CONF}
|
||||
- ${DOCKER_FINANCE_CLIENT_FLOW}:${DOCKER_FINANCE_CONTAINER_FLOW}
|
||||
# Connects client-side (host) custom container plugins (not repo's container plugins)
|
||||
- ${DOCKER_FINANCE_CLIENT_PLUGINS}/container:${DOCKER_FINANCE_CONTAINER_PLUGINS}:ro
|
||||
- ${DOCKER_FINANCE_CLIENT_REPO}/container:${DOCKER_FINANCE_CONTAINER_REPO}:ro
|
||||
- ${DOCKER_FINANCE_CLIENT_SHARED}:${DOCKER_FINANCE_CONTAINER_SHARED}
|
||||
# Needed for when upstream data is localtime instead of UTC
|
||||
# NOTE: although TZ can be used within the container, this should be more dynamic
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
environment:
|
||||
- DOCKER_FINANCE_CONTAINER_CMD=${DOCKER_FINANCE_CONTAINER_CMD}
|
||||
- DOCKER_FINANCE_CONTAINER_CONF=${DOCKER_FINANCE_CONTAINER_CONF}
|
||||
- DOCKER_FINANCE_CONTAINER_EDITOR=${DOCKER_FINANCE_CONTAINER_EDITOR}
|
||||
- DOCKER_FINANCE_CONTAINER_FLOW=${DOCKER_FINANCE_CONTAINER_FLOW}
|
||||
- DOCKER_FINANCE_CONTAINER_PLUGINS=${DOCKER_FINANCE_CONTAINER_PLUGINS}
|
||||
- DOCKER_FINANCE_CONTAINER_REPO=${DOCKER_FINANCE_CONTAINER_REPO}
|
||||
- DOCKER_FINANCE_CONTAINER_SHARED=${DOCKER_FINANCE_CONTAINER_SHARED}
|
||||
- DOCKER_FINANCE_DEBUG=${DOCKER_FINANCE_DEBUG}
|
||||
- DOCKER_FINANCE_VERSION=@DOCKER_FINANCE_VERSION@
|
||||
- GID=${DOCKER_FINANCE_GID}
|
||||
- UID=${DOCKER_FINANCE_UID}
|
||||
# Container's view of client's hledger-flow (for logging purposes)
|
||||
- DOCKER_FINANCE_CLIENT_FLOW=${DOCKER_FINANCE_CLIENT_FLOW}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: ${DOCKER_FINANCE_CPUS}
|
||||
memory: ${DOCKER_FINANCE_MEMORY}
|
||||
restart: no
|
||||
init: true
|
||||
networks:
|
||||
docker-finance:
|
||||
ports:
|
||||
- ${DOCKER_FINANCE_PORT_HLEDGER}:5000
|
||||
- ${DOCKER_FINANCE_PORT_ROOT}:8080
|
||||
|
||||
networks:
|
||||
docker-finance:
|
||||
external: true
|
||||
name: @DOCKER_FINANCE_NETWORK@
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
41
client/Dockerfiles/local/finance/entrypoint.bash
Executable file
41
client/Dockerfiles/local/finance/entrypoint.bash
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# *** WARNING: REQUIRES GENERATED CLIENT ENVIRONMENT ***
|
||||
#
|
||||
|
||||
if [ -z "$DOCKER_FINANCE_CONTAINER_REPO" ]; then
|
||||
echo "FATAL: DOCKER_FINANCE_CONTAINER_REPO not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$DOCKER_FINANCE_CONTAINER_FLOW" ]; then
|
||||
echo "FATAL: DOCKER_FINANCE_CONTAINER_FLOW not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dynamically connect hledger-flow source with end-user hledger-flow structure
|
||||
# TODO: annoying, find a better way
|
||||
ln -f -s "${DOCKER_FINANCE_CONTAINER_REPO}/src/hledger-flow" "${DOCKER_FINANCE_CONTAINER_FLOW}/src"
|
||||
|
||||
# Keep container running
|
||||
tail -f /dev/null
|
||||
|
||||
exec "$@"
|
||||
44
client/Dockerfiles/local/finance/ubuntu/Dockerfile.fetch.in
Normal file
44
client/Dockerfiles/local/finance/ubuntu/Dockerfile.fetch.in
Normal file
@@ -0,0 +1,44 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'fetch' module
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
RUN apt-get install -y \
|
||||
composer \
|
||||
curl \
|
||||
php \
|
||||
php-bcmath \
|
||||
php-curl \
|
||||
php-gmp \
|
||||
proxychains4
|
||||
|
||||
# Add builder user for `composer`
|
||||
RUN useradd -m -s /bin/bash -r builder
|
||||
|
||||
USER builder
|
||||
WORKDIR /usr/local/lib/php
|
||||
|
||||
RUN composer require ozdemirburak/json-csv
|
||||
RUN composer require ccxt/ccxt
|
||||
# "Sunsetted" Coinbase Pro
|
||||
#RUN composer require mocking-magician/coinbase-pro-sdk
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
69
client/Dockerfiles/local/finance/ubuntu/Dockerfile.root.in
Normal file
69
client/Dockerfiles/local/finance/ubuntu/Dockerfile.root.in
Normal file
@@ -0,0 +1,69 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'root' module
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
# ROOT.cern dependencies (regardless of building or not)
|
||||
RUN apt-get install -y \
|
||||
binutils \
|
||||
cmake \
|
||||
dpkg-dev \
|
||||
g++ \
|
||||
gcc \
|
||||
libssl-dev \
|
||||
libtbb-dev \
|
||||
libx11-dev \
|
||||
libxext-dev \
|
||||
libxft-dev \
|
||||
libxpm-dev \
|
||||
python3
|
||||
|
||||
# ROOT.cern pre-compiled installation
|
||||
RUN apt-get install -y curl
|
||||
WORKDIR /usr/local/src
|
||||
RUN curl --location -O "https://root.cern/download/root_v6.32.02.Linux-ubuntu24.04-x86_64-gcc13.2.tar.gz"
|
||||
RUN tar xvzf "root_v6.32.02.Linux-ubuntu24.04-x86_64-gcc13.2.tar.gz"
|
||||
|
||||
# ROOT.cern environment
|
||||
#
|
||||
# bash_aliases notes:
|
||||
#
|
||||
# - *MUST* source thisroot.sh (from any directory)
|
||||
#
|
||||
# - For `docker-finance version` command:
|
||||
#
|
||||
# - To avoid thisroot.sh error, pushd/popd is required (per thisroot.sh)
|
||||
#
|
||||
# - Although $ROOTSYS will be available during normal operation, it won't
|
||||
# be avaialble to `docker-finance version`- so add binary to PATH here.
|
||||
RUN echo "pushd /usr/local/src/root/bin 1>/dev/null && source \"/usr/local/src/root/bin/thisroot.sh\" && popd 1>/dev/null" >>/etc/bash.bashrc
|
||||
RUN echo "export PATH=\"\$PATH::/usr/local/src/root/bin\"" >>/etc/bash.bashrc
|
||||
|
||||
# docker-finance
|
||||
USER root
|
||||
RUN apt-get install -y \
|
||||
googletest \
|
||||
libbenchmark-dev \
|
||||
libbotan-2-dev \
|
||||
libcrypto++-dev \
|
||||
libsodium-dev
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
29
client/Dockerfiles/local/finance/ubuntu/Dockerfile.track.in
Normal file
29
client/Dockerfiles/local/finance/ubuntu/Dockerfile.track.in
Normal file
@@ -0,0 +1,29 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'track' module
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
RUN apt-get install -y \
|
||||
git \
|
||||
timewarrior \
|
||||
visidata
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
33
client/Dockerfiles/local/finance/ubuntu/Dockerfile.user.in
Normal file
33
client/Dockerfiles/local/finance/ubuntu/Dockerfile.user.in
Normal file
@@ -0,0 +1,33 @@
|
||||
# docker-finance | modern accounting for the power-user
|
||||
#
|
||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#
|
||||
# 'user' module
|
||||
#
|
||||
|
||||
# Remove default 'ubuntu' user which may conflict with host user's UID/GID (1000:1000)
|
||||
USER root
|
||||
RUN userdel -r ubuntu
|
||||
|
||||
# Add 'finance' user
|
||||
RUN useradd -m -s /bin/bash @DOCKER_FINANCE_USER@ -u @DOCKER_FINANCE_UID@
|
||||
|
||||
USER @DOCKER_FINANCE_USER@
|
||||
RUN echo "source \"\${DOCKER_FINANCE_CONTAINER_CONF}/shell/superscript.bash\"" >>~/.bash_aliases
|
||||
RUN echo "source \"\${DOCKER_FINANCE_CONTAINER_REPO}/src/finance/completion.bash\"" >>~/.bash_aliases
|
||||
|
||||
# vim: sw=2 sts=2 si ai et
|
||||
Reference in New Issue
Block a user