See More

# EXAMPLE USAGE: docker run --rm codewars/python-runner run -l python -c "print 1+1 " # docker run --rm codewars/python-runner run -l python3 -c "print(1+1)" # Pull base image. FROM codewars/base-runner RUN apt-get update -qq RUN apt-get install -y build-essential checkinstall # Install pip RUN apt-get install -y python-pip python3-pip # Install Python 3.6 RUN add-apt-repository ppa:fkrull/deadsnakes RUN apt-get update -qq RUN apt-get install -y python3.6 # Install Additional Python2 libraries RUN apt-get install -y python-numpy python-scipy python-pandas # Install Python3 libraries RUN apt-get install -y python3-numpy python3-scipy python3-pandas # Install Packages RUN pip install pymongo redis RUN pip3 install pymongo redis # Install TensorFlow for deep learning capabilities (CPU support only) RUN pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl RUN pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl # Install Scikit-learn RUN pip install -U scikit-learn RUN pip3 install -U scikit-learn # Install Tornado RUN pip install -U tornado RUN pip3 install -U tornado # Install Ably RUN pip install -U ably RUN pip3 install -U ably # Install Django ENV DJANGO_VERSION 1.9.8 RUN pip install -U psycopg2 django=="$DJANGO_VERSION" RUN pip3 install -U psycopg2 django=="$DJANGO_VERSION" # Install PySVG RUN pip install -U pysvg RUN pip3 install -U pysvg # Install mpld3 package for rendering images to browser RUN pip install mpld3 RUN pip3 install mpld3 RUN pip install Jinja Jinja2 RUN pip3 install Jinja2 # Install PyCrypto RUN pip install -U pycrypto RUN pip3 install -U pycrypto # Install gmpy2 for Python2/Python3 RUN apt-get install -y python-gmpy2 python3-gmpy2 # Install beautiful soup RUN apt-get install -y python-bs4 # Install some misc popular packages RUN pip install pypattyrn python_jwt jws cerberus colander tox pygal RUN pip3 install coala-bears pypattyrn cerberus colander tox pygal # Install pylint RUN apt-get install -y pylint # Install additional DB related packages RUN pip install pickledb tinydb ZODB dataset psycopg2 queries RUN pip3 install pickledb tinydb ZODB dataset psycopg2 queries RUN ln -s /home/codewarrior /workspace ENV NPM_CONFIG_LOGLEVEL warn WORKDIR /runner COPY package.json package.json RUN npm install --production COPY *.js ./ COPY lib/*.js lib/ COPY lib/*.sh lib/ COPY lib/utils lib/utils COPY lib/runners/python.js lib/runners/ COPY lib/runners/python3.js lib/runners/ COPY examples/python.yml examples/ COPY examples/python3.yml examples/ COPY frameworks/python frameworks/python COPY frameworks/python3 frameworks/python3 COPY test/runner.js test/ COPY test/runners/python_spec.js test/runners/ COPY entrypoint.sh entrypoint.sh RUN chmod +x entrypoint.sh USER codewarrior ENV USER=codewarrior HOME=/home/codewarrior RUN mocha -t 5000 test/runners/python_spec.js ENTRYPOINT ["./entrypoint.sh"]