Skip to content

Commit

Permalink
Add data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fuentes committed Jan 24, 2023
1 parent b9bd1a9 commit 08e775c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ADD ./ /app
WORKDIR /app
RUN pip install -r requirements.txt
VOLUME /data
VOLUME /tmp
ENV USERNAME example
ENV PASSWORD examplePassword
ENTRYPOINT ["python", "-m", "garminworkouts", "--cookie-jar", "/data/.garmin-cookies.txt"]
ENTRYPOINT ["python", "-m", "garminworkouts", "--cookie-jar", "/tmp/.garmin-cookies.txt"]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,9 @@ docker build --load -t ${IMAGE} .
docker run --env-file=./.env -v /tmp/garmin:/data -ti ${IMAGE} [your command and arguments: list, export, etc.]
# alternatively you can use this wrapper
./dockerwrap.sh [your command and arguments: list, export, etc.]
# in case you want to export to a directory, you need to use /data
# inside the container and point DATADIR to the local dir where to
# write the data (./ by default).
export DATADIR=/path/where/to/store/data/locally
./dockerwrap.sh export /data
```
4 changes: 2 additions & 2 deletions dockerwrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set -u
IMAGE="${IMAGE}"
ENVFILE="${ENVFILE-.env}"
TMPDIR="${TMPDIR-/tmp/garmin}"

exec docker run --env-file=${ENVFILE} -v ${TMPDIR}:/data -ti ${IMAGE} $@
DATADIR="${DATADIR-./}"
exec docker run --env-file=${ENVFILE} -v ${TMPDIR}:/tmp -v ${DATADIR}:/data/ -ti ${IMAGE} $@

0 comments on commit 08e775c

Please sign in to comment.