From 6f0f0af458131764bf7eb889eca01c644b407817 Mon Sep 17 00:00:00 2001 From: Marc Portier Date: Wed, 17 Nov 2021 17:28:49 +0100 Subject: [PATCH] introduces docker deploy for running pysubyt command-line initial stab at issue #25 --- Dockerfile | 11 +++++++++++ docker.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 Dockerfile create mode 100644 docker.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f65efe5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.8-buster + +COPY ./ /pysubyt +WORKDIR /pysubyt + +RUN python -m pip install --upgrade pip && \ + pip install --no-cache-dir -r requirements.txt && \ + python setup.py install + +ENTRYPOINT ["pysubyt"] + diff --git a/docker.md b/docker.md new file mode 100644 index 0000000..b4a2f34 --- /dev/null +++ b/docker.md @@ -0,0 +1,42 @@ +TODO: describe how to use the docker thingy + + +build image + +```bash +$ docker build . -t pysubyt +``` + +test if it runs +```bash +$ docker run pysubyt --help +``` + +actually run pysubyt in the docker container accessing templates and input from the host + +```bash +$ docker run \ + -v $(realpath .)/tests/templates:/tpl \ + -v $(realpath \.)/tests/in:/in \ + pysubyt -t /tpl -i /in/data.csv -n 01-basic.ttl +``` + + + +TODO consider a bash function dock-subyt() that takes arguments to execute pysubyt via docker +- then provide that as a sh file that can be sourced +- as well as have a ```make docker``` target to have image build + source that ```docker build -t pysubit && source pysubyt-docker-define.sh``` + + +dock-subyt +** args to manipulate (all optional) + -t «path that should be made absolute and mapped to /tpl» + -i «path that should be made absolute and mapped to /in»/inputname + -o «path that should be made absolute and mapped to /out»/outputname + -s KEY «path that should be made absolute and mapped to /set-${KEY}/inputname +** args to pass through + -n «name to pass through» + -m «modifier to pass through» + -h + +