diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7c27fc1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM python:2.7-slim + +RUN apt-get clean && apt-get update && apt-get install -y --no-install-recommends \ + git \ + gcc \ + libpng-dev \ + libfreetype6-dev \ + libopenblas-dev \ + liblapack-dev \ + libatlas-base-dev \ + libssl-dev \ + libhdf5-dev \ + && git clone --branch v2.3 --depth 1 \ + http://jro-dev.igp.gob.pe/rhodecode/schain \ + && pip install numpy \ + && cd schain \ + && pip install . \ + && rm -rf * \ + && apt-get purge -y --auto-remove git gcc \ + && rm -rf /var/lib/apt/lists/* + +ENV BACKEND="Agg" + +VOLUME /data + +ENTRYPOINT ["schain"] diff --git a/README.md b/README.md index 520f3a8..a04a8a8 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,20 @@ $ source /path/to/virtual/bin/activate (virtual) $ bash link_PyQt4.sh ``` +### Docker + +Download Dockerfile from the repository, and create a docker image + +``` +$ docker build -t schain . +``` + +You can run a container using an xml file or a schain script also you need to mount a volume for the data input and for the output files/plots +``` +$ docker run -it --rm --volume /path/to/host/data:/data schain xml /data/test.xml +$ docker run -it --rm --volume /path/to/host/data:/data --entrypoint=/bin/python schain /data/test.py +``` + ## First Script Read Spectra data (.pdata) - remove dc - plot spectra & RTI