File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM python:2.7.11
2+ MAINTAINER Fiona Hasanaj
3+
4+ # install necessary software
5+ RUN apt-get -y update && apt-get install -y vim && apt-get install -y git && pip install tox
6+
7+ COPY run_python.sh /python/examples/run_python.sh
8+ RUN chmod 755 /python/examples/run_python.sh
9+ WORKDIR /python/examples
10+
11+ # allow interactive bash inside docker container
12+ CMD ./run_python.sh $API_KEY $ALT_URL
13+
14+ VOLUME ["/source" ]
Original file line number Diff line number Diff line change 1+ ---
2+ # Docker Image for Python Examples
3+ ---
4+ ### Summary
5+ To simplify the running of the Python examples, the Dockerfile will build an image and install the latest rosette-api library from composer.
6+
7+ ### Basic Usage
8+ Build the docker image, e.g. ` docker build -t basistech/python:1.1 . `
9+
10+ Run an example as ` docker run -e API_KEY=api-key -v "path-to-example-source:/source" basistech/python:1.1 `
11+
12+ To test against an alternate url, add ` -e ALT_URL=alternate_url ` before the ` -v `
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # reference the API
4+ curl " https://api.rosette.com/rest/v1/ping" -H " user_key: $1 "
5+
6+ cp /source/* .* .
7+
8+ if [ ! -z " $2 " ]; then
9+ find -maxdepth 1 -name ' *.py' -print -exec tox -- {} --key $1 --url $2 \;
10+ else
11+ find -maxdepth 1 -name ' *.py' -print -exec tox -- {} --key $1 \;
12+ fi
You can’t perform that action at this time.
0 commit comments