Skip to content

Commit 1ef6ee1

Browse files
author
Lowtower
committed
Changes from flopp#114
# Conflicts: # .gitignore
1 parent 9d888a9 commit 1ef6ee1

4 files changed

Lines changed: 43 additions & 14 deletions

File tree

.env.example

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# Refer to the README or `create_poster -h` for details on the below options
2+
3+
TYPE="grid"
14
TITLE="Running"
2-
YEAR="2017"
3-
ATHLETE="Your name here"
4-
UNITS="imperial"
5-
EXTRA_OPTIONS=
5+
YEAR="2024"
6+
ATHLETE="John Doe"
7+
UNITS="metric"
8+
EXTRA_OPTIONS=

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ sdist
5858
.mypy_cache/*
5959

6060
# Project specific
61+
.env
6162
site/*
63+
gpx/*
6264
gpx_dir/*
6365
output/*
6466
data

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Create a visually appealing poster from your GPX tracks - heavily inspired by https://www.instagram.com/p/Behppx9HCfx/
77

88
## Setup
9+
### Local
910
1. Clone the repository: `git clone https://github.com/flopp/GpxTrackPoster.git`
1011
2. `cd GpxTrackPoster`
1112
3. Create virtualenv: `virtualenv -p /usr/bin/python3 venv` or `python -m venv venv`
@@ -17,8 +18,19 @@ Create a visually appealing poster from your GPX tracks - heavily inspired by ht
1718

1819
### Container
1920
There is a Dockerfile in this repository, which you can use to run this software.
20-
1. Build the container: `podman build -f Dockerfile -t gpxtrackposter:latest`
21-
2. Run the container to build your poster: `podman run --rm -v /my/gpx/files:/gpx --name gpxtrackposter localhost/gpxtrackposter:latest create_poster --gpx-dir /gpx --output /gpx/poster.svg`
21+
22+
1. Build the container: `podman build -f Dockerfile -t gpxtrackposter:latest`.
23+
2. Run the container to build your poster:
24+
```
25+
podman run --rm -v ./gpx/:/usr/src/app/gpx -v ./output:/usr/src/app/output \
26+
--name gpxtrackposter localhost/gpxtrackposter:latest \
27+
create_poster --gpx-dir /usr/src/app/gpx --output /usr/src/app/output/poster.svg
28+
```
29+
30+
Alternatively you can use the included `docker-compose.yml`, which will do all the above for you.
31+
32+
1. Copy the `.env.example` to `.env` and adapt it to your needs.
33+
2. Run `podman compose up` in the root of this directory.
2234
2335
## Usage
2436
First of all, you need directory with a bunch of GPX files (e.g. you can export all your tracks from Garmin Connect with the excellent tool [garmin-connect-export](https://github.com/kjkjava/garmin-connect-export), or use [StravaExportToGPX](https://github.com/flopp/StravaExportToGPX), or use [runtastic](https://github.com/yihong0618/Runtastic), or use [nrc-exporter](https://github.com/yasoob/nrc-exporter) to convert the activities in a Strava or Runtastic or `Nike Run Club` export zip file to GPX or GPX files).

docker-compose.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
app:
2-
build: .
3-
env_file:
4-
- .env
5-
command: /usr/src/app/create_poster.py --type grid --gpx-dir /usr/src/app/gpx_dir --year $YEAR --title $TITLE --athlete $ATHLETE --units $UNITS $EXTRA_OPTIONS --output /usr/src/app/output/output.svg
6-
volumes:
7-
- ./output:/usr/src/app/output
8-
- ./gpx_dir:/usr/src/app/gpx_dir
1+
name: gpxtrackposter
2+
services:
3+
create:
4+
build: ./
5+
image: gpxtrackposter:latest
6+
restart: "no"
7+
env_file:
8+
- .env
9+
command: "/usr/local/bin/create_poster \
10+
--type ${TYPE:-'grid'} \
11+
--title ${TITLE:-'Running'} \
12+
--year ${YEAR:-'2024'} \
13+
--athlete ${ATHLETE:-'John Doe'} \
14+
--units ${UNITS:-'metric'} \
15+
--gpx-dir /usr/src/app/gpx \
16+
${EXTRA_OPTIONS:-'--verbose'} \
17+
--output /usr/src/app/output/output.svg"
18+
volumes:
19+
- ./output:/usr/src/app/output
20+
- ./gpx:/usr/src/app/gpx

0 commit comments

Comments
 (0)