Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile #471

Merged
merged 7 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM alpine:edge

RUN apk --no-cache add \
inkscape \
make \
ncurses \
pandoc-cli \
perl \
py3-pygments \
py3-boto3 \
py3-requests \
python3 \
texlive \
texlive-luatex \
texmf-dist \
texmf-dist-formatsextra \
texmf-dist-latexextra \
texmf-dist-pictures \
texmf-dist-science \
wget


RUN luaotfload-tool --update
RUN apk --no-cache add py3-pandas
RUN apk --no-cache add pipx
RUN pipx install cgt-calc
RUN pipx ensurepath

WORKDIR /data

ENTRYPOINT ["/bin/bash"]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pipx install cgt-calc

- Python 3.8 or above.
- `pdflatex` is required to generate the report.
- [Optional] Docker

## Install LaTeX

Expand All @@ -42,6 +43,27 @@ apt install texlive-latex-base

[Install MiKTeX.](https://miktex.org/download)

### Docker

These steps will build and run the calculator in a self-contained environment, in case you would rather not have a systemwide LaTeX installation (or don't want to interfere with an existing one).
The following steps are tested on an Apple silicon Mac and may need to be slightly modified on other platforms.
With the cloned repository as the current working directory:

```shell
$ docker buildx build --platform linux/amd64 --tag capital-gains-calculator
```

Now you've built and tagged the calculator image, you can drop into a shell with `cgt-calc` installed on `$PATH`. Navigate to where you store your transaction data, and run:

```shell
$ cd ~/Taxes/Transactions
$ docker run --rm -it -v "$PWD":/data capital-gains-calculator:latest
a4800eca1914:/data# cgt-calc [...]
```

This will create a temporary Docker container with the current directory on the host (where your transaction data is) mounted inside the container at `/data`. Follow the usage instructions below as normal,
and when you're done, simply exit the shell. You will be dropped back into the shell on your host, with your output report pdf etc..

## Usage

You will need several input files:
Expand Down