|
1 | 1 | # Takes around 15-20 minutes to run the first time (depending on your computer) |
2 | | -FROM alpine:3.6 |
3 | | - |
4 | | -ENV ALPINE_VERSION=3.6 \ |
5 | | - PACKAGES="bash ca-certificates python2 py-setuptools curl" |
6 | | - |
7 | | -# Set the PYTHON STUPID UNICODE EOFUBDHSKJOIWEJNOIEFNODKL |
8 | | -ENV PYTHONIOENCODING UTF-8 |
9 | | - |
10 | | -# Replacing default repositories with edge ones |
11 | | -RUN echo \ |
12 | | - # && echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" > /etc/apk/repositories \ |
13 | | - && echo "http://dl-cdn.alpinelinux.org/alpine/v$ALPINE_VERSION/community" >> /etc/apk/repositories |
14 | | - # && echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories |
15 | | - |
16 | | -# Add the packages, with a CDN-breakage fallback if needed |
17 | | -RUN echo \ |
18 | | - && apk add --no-cache $PACKAGES || \ |
19 | | - (sed -i -e 's/dl-cdn/dl-4/g' /etc/apk/repositories && apk add --no-cache $PACKAGES) |
20 | | - |
21 | | -# turn back the clock - hacky lmao |
22 | | -RUN echo \ |
23 | | - # && echo "http://dl-cdn.alpinelinux.org/alpine/v$ALPINE_VERSION/main/" > /etc/apk/repositories |
24 | | - # && echo "@edge-testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ |
25 | | - # && echo "@edge-community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ |
26 | | - # && echo "@edge-main http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \ |
27 | | - |
28 | | - # make some useful symlinks that are expected to exist |
29 | | - RUN echo \ |
30 | | - && if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python2.7 /usr/bin/python; fi \ |
31 | | - && if [[ ! -e /usr/bin/python-config ]]; then ln -sf /usr/bin/python2.7-config /usr/bin/python-config; fi \ |
32 | | - && if [[ ! -e /usr/bin/easy_install ]]; then ln -sf /usr/bin/easy_install-2.7 /usr/bin/easy_install; fi |
33 | | - |
34 | | -# Install and upgrade Pip |
35 | | -RUN echo \ |
36 | | - && easy_install pip \ |
37 | | - && pip install --upgrade pip \ |
38 | | - && if [[ ! -e /usr/bin/pip ]]; then ln -sf /usr/bin/pip2.7 /usr/bin/pip; fi |
39 | | - |
40 | | -# Install geos-dev and some other packages for shapely |
41 | | -RUN apk update && apk upgrade && apk add --no-cache --update build-base |
42 | | - |
43 | | -# Add GEOS for shapely |
44 | | -RUN echo "http://mirror.leaseweb.com/alpine/edge/testing/" >> /etc/apk/repositories |
45 | | -RUN apk add --no-cache geos-dev |
46 | | - |
47 | | -# Install needed packages |
48 | | -# https://github.com/jfloff/alpine-python/issues/24?fbclid=lwAR08KeopkO3ET6hz8iZ6bV0hEljjpHZaKR2bXMZAUjJsKnauzDLflzeTdpTY |
49 | | -RUN set -ex ;\ |
50 | | - echo "@community http://dl-cdn.alpinelinux.org/alpine/v$ALPINE_VERSION/community" >> /etc/apk/repositories ;\ |
51 | | - apk add --no-cache --update \ |
52 | | - openblas-dev@community \ |
53 | | - expat@community \ |
54 | | - ;\ |
55 | | - rm /var/cache/apk/* |
56 | | - |
57 | | -# Install numpy and scipy for ml categories |
58 | | -# Takes 5 years to run... building this part as the base image |
59 | | -# It is cached but just in case we're adding this image |
60 | | -# https://gist.github.com/orenitamar/f29fb15db3b0d13178c1c4dd611adce2 |
61 | | -# Dmaa split these into separate lines for debugging |
62 | | -RUN apk add --update-cache gcc |
63 | | -RUN apk add --update-cache gfortran |
64 | | -RUN apk add --update-cache python |
65 | | -RUN apk add --update-cache python-dev |
66 | | -RUN apk add --update-cache py-pip |
67 | | -RUN apk add --update-cache build-base |
68 | | -RUN apk add --update-cache wget |
69 | | -RUN apk add --update-cache freetype-dev |
70 | | -RUN apk add --update-cache libpng-dev |
71 | | -RUN apk add --update-cache expat |
72 | | -RUN apk add --update-cache postgresql-dev |
73 | | -RUN apk add --update-cache musl-dev |
74 | | -RUN pip install --upgrade pip |
75 | | -RUN pip install numpy scipy gensim |
| 2 | +FROM mappening/base |
76 | 3 |
|
77 | 4 | # Install the rest of the packages |
78 | 5 | COPY requirements.txt /tmp |
79 | | -RUN cd /tmp && pip install -r requirements.txt |
| 6 | +RUN cd /tmp && pip3 install -r requirements.txt |
80 | 7 |
|
81 | 8 | WORKDIR /app |
82 | 9 | COPY . . |
83 | 10 | RUN ls -l |
84 | 11 |
|
85 | 12 | EXPOSE 5000 |
86 | | -CMD ["python", "app.py", "-p"] |
| 13 | +CMD ["python3", "app.py"] |
0 commit comments