forked from codewars/codewars-runner-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.docker
More file actions
110 lines (81 loc) · 2.96 KB
/
python.docker
File metadata and controls
110 lines (81 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# 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"]