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

Enhance README: Add Docker Compose Example and Improve Environment Variable Formatting #31

Merged
merged 4 commits into from
Oct 24, 2023
Merged
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
45 changes: 36 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,48 @@

A Dockerfile for beancount-fava

## Environment Variable

- `BEANCOUNT_FILE`: path to your beancount file. Default to empty string.

## Usage Example

You can get started creating a container from this image, you can either use docker-compose or the docker cli.

Assuming you have `example.bean` in the current directory:

### Docker Cli

```bash
# assume you have example.bean in the current directory
docker run -v $PWD:/bean -e BEANCOUNT_FILE=/bean/example.bean yegle/fava
docker run -d \
--name=syncthing \
-v $PWD:/bean \
-e BEANCOUNT_FILE=/bean/example.bean \
-p 5000:5000 \
--restart unless-stopped \
yegle/fava
```

NOTE: The command above does not expose the Fava HTTP server port outside of Docker's internal network.
This allows you [to use your own reverse proxy](https://github.com/beancount/fava/tree/main/contrib/docker#advanced).
If you do want to expose the service without using a reverse proxy for local testing, you must add `-p 5000:5000`
to access Fava on http://localhost:5000.
### Docker Compose

```yml
---
version: "3.0"
services:
fava:
container_name: fava
image: yegle/fava
ports:
- 5000:5000
environment:
- BEANCOUNT_FILE=/bean/example.beancount
volumes:
- ${PWD}/:/bean
restart: unless-stopped
```

## Environment Variable

| Parameter | Value |
| :----: | --- |
| `BEANCOUNT_FILE` | path to your beancount file. Default to empty string. |

## Note on auto build

Expand Down
Loading