Skip to content

Commit

Permalink
Merge pull request #209 from GeoDerp/persistent-storage-docs
Browse files Browse the repository at this point in the history
persistent storage docs
  • Loading branch information
davidusb-geek authored Feb 27, 2024
2 parents 962a1b7 + b958809 commit d4661ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,15 @@ Then load the image in the .tar file:
docker load -i <TarFileName>.tar
```
Finally check your image tag with `docker images` and launch the docker itself:
```
```bash
docker run -it --restart always -p 5000:5000 -e "LOCAL_COSTFUN=profit" -v $(pwd)/config_emhass.yaml:/app/config_emhass.yaml -v $(pwd)/secrets_emhass.yaml:/app/secrets_emhass.yaml --name DockerEMHASS <REPOSITORY:TAG>
```
- If you wish to keep a local, persistent copy of the EMHASS generated data, create a local folder on your device, then mount said folder inside the container.
```bash
mkdir -p $(pwd)/data #linux: create data folder on local device

docker run -it --restart always -p 5000:5000 -e "LOCAL_COSTFUN=profit" -v $(pwd)/config_emhass.yaml:/app/config_emhass.yaml -v $(pwd)/data:/app/data -v $(pwd)/secrets_emhass.yaml:/app/secrets_emhass.yaml --name DockerEMHASS <REPOSITORY:TAG>
```

### Method 3) Legacy method using a Python virtual environment

Expand Down
5 changes: 5 additions & 0 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ docker build -t emhass/docker --build-arg build_version=addon-pip .
docker run -it -p 5000:5000 --name emhass-container -e LAT="45.83" -e LON="6.86" -e ALT="4807.8" -e TIME_ZONE="Europe/Paris" -e CONFIG_PATH='/app/config_emhass.yaml' -e DATA_PATH='/app/data/' -e OPTIONS_PATH='/app/options.json' -v $(pwd)/options.json:/app/options.json emhass/docker --url YOURHAURLHERE --key YOURHAKEYHERE
```

#### Sync with local data folder
For those who wish to mount/sync the local `data` folder with the data folder from the docker container, volume mount the data folder with `-v` .
```bash
docker run ... -v $(pwd)/data/:/app/data ...
```

#### Delete built Docker image

Expand Down

0 comments on commit d4661ee

Please sign in to comment.