Skip to content

Commit

Permalink
Docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
meltaxa committed Mar 20, 2021
1 parent 2c2b742 commit d4852e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ RUN apt-get update && \

RUN pip3 install --upgrade pip wheel && pip3 install --upgrade -r requirements.txt

ENV PYTHONPATH="/musicfig:$PYTHONPATH"
ENV PYTHONPATH="/config:$PYTHONPATH"

CMD ["python3", "run.py"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ When running Docker, the device path will correspond to the bus and device numbe

Run Docker:
```
docker run -v <path/to/musicfig>:/musicfig -p 5000:5000 --device=/dev/bus/usb/<bus>/<device> --device=/dev/snd meltaxa/musicfig
docker run -v <path/to/configs>:/config -p 5000:5000 --device=/dev/bus/usb/<bus>/<device> --device=/dev/snd meltaxa/musicfig
```
The /path/to/musicfig is the directory where you store the config.py and tags.yml files.
The /path/to/configs is the directory where you store the config.py and tags.yml files.

# Stopping and Starting

Expand Down
6 changes: 5 additions & 1 deletion app/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import os
import yaml
from pathlib import Path

class Tags():

def __init__(self):
current_dir = os.path.dirname(os.path.abspath(__file__))
self.tags_file = current_dir + '/../tags.yml'
if Path(current_dir + '/../tags.yml').is_file():
self.tags_file = current_dir + '/../tags.yml'
if Path('/config/tags.yml').is_file():
self.tags_file = '/config/tags.yml'
self.last_updated = ''

def load_tags(self):
Expand Down

0 comments on commit d4852e0

Please sign in to comment.