diff --git a/Dockerfile b/Dockerfile index 73cb0813..d594f3b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index c3f21fce..5034d334 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/dockerwrap.sh b/dockerwrap.sh index 6f841765..9db60852 100755 --- a/dockerwrap.sh +++ b/dockerwrap.sh @@ -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} $@