Skip to content

Commit

Permalink
Enhance README: Add Docker Compose Example and Improve Environment Va…
Browse files Browse the repository at this point in the history
…riable Formatting (#31)

* Added a docker compose example with port

* Modified the order of examples

* Moved container name

* Typos and added env variables table

---------

Co-authored-by: samurai <[email protected]>
  • Loading branch information
guglielmobartelloni and samurai committed Oct 24, 2023
1 parent b1ad07f commit ebe63f0
Showing 1 changed file with 36 additions and 9 deletions.
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

0 comments on commit ebe63f0

Please sign in to comment.