forked from domenicosolazzo/jroc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.deploy
136 lines (116 loc) · 5.82 KB
/
Dockerfile.deploy
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
FROM heroku/cedar:14
ENV DEBIAN_FRONTEND noninteractive
ENV DISTRO trusty
RUN echo "Setting the environmental variables..."
ENV PATH /app/.apt/usr/bin:$PATH
ENV LD_LIBRARY_PATH /app/.apt/usr/lib/x86_64-linux-gnu:/app/.apt/usr/lib/i386-linux-gnu:/app/.apt/usr/lib:$LD_LIBRARY_PATH
ENV LIBRARY_PATH /app/.apt/usr/lib/x86_64-linux-gnu:/app/.apt/usr/lib/i386-linux-gnu:/app/.apt/usr/lib:$LIBRARY_PATH
ENV INCLUDE_PATH /app/.apt/usr/include:$INCLUDE_PATH
ENV CPATH $INCLUDE_PATH
ENV CPPPATH $INCLUDE_PATH
ENV PKG_CONFIG_PATH /app/.apt/usr/lib/x86_64-linux-gnu/pkgconfig:/app/.apt/usr/lib/i386-linux-gnu/pkgconfig:/app/.apt/usr/lib/pkgconfig:$PKG_CONFIG_PATH
ENV OBT_TYPE tag-nostat-bm.sh
RUN useradd -d /app -m app
RUN echo "Configuring the container...."
RUN uname --all
RUN echo "Installing Apertium GnuPG key to /etc/apt/trusted.gpg.d/apertium.gpg"
RUN wget -q http://apertium.projectjj.com/apt/apertium-packaging.public.gpg -O /etc/apt/trusted.gpg.d/apertium.gpg
RUN echo "Creating /etc/apt/sources.list.d/apertium-nightly.list"
RUN echo "deb http://apertium.projectjj.com/apt/nightly $DISTRO main" > /etc/apt/sources.list.d/apertium-nightly.list \
&& apt-get update \
&& apt-get -o dir::cache=/tmp/apt install -y -d g++ libicu-dev subversion git cmake libboost-dev build-essential libgoogle-perftools-dev cg3 vim nano \
&& rm -rf /var/lib/apt/lists/* \
&& for DEB in $(ls -1 /tmp/apt/archives/*.deb); do echo "Installing $(basename $DEB)"; dpkg -x $DEB /app/.apt/; done \
&& apt-get -y clean
RUN echo "All done - enjoy the packages! If you just want all core tools, do: sudo apt-get install apertium-all-dev"
# Cedar packages
RUN apt-get update
# Used this hack for fixing an issue with packages asking for input while setting up
# More info: http://stackoverflow.com/questions/22957939/how-to-answer-an-apt-get-configuration-change-prompt-on-travis-ci-in-this-case
RUN DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" upgrade --force-yes
RUN apt-get install -y --force-yes \
autoconf \
bind9-host \
bison \
build-essential \
coreutils \
curl \
daemontools \
dnsutils \
ed \
git \
imagemagick \
iputils-tracepath \
language-pack-en \
libbz2-dev \
libcurl4-openssl-dev \
libevent-dev \
libev-dev \
libglib2.0-dev \
libjpeg-dev \
libmagickwand-dev \
libmysqlclient-dev \
libncurses5-dev \
libpq-dev \
libpq5 \
librdkafka-dev \
libreadline6-dev \
libssl-dev \
libxml2-dev \
libxslt-dev \
libuv-dev \
netcat-openbsd \
openjdk-7-jdk \
openjdk-7-jre-headless \
openssh-client \
openssh-server \
postgresql-client-9.5 \
postgresql-server-dev-9.5 \
python \
python-dev \
ruby \
ruby-dev \
socat \
stunnel \
syslinux \
tar \
telnet \
zip \
zlib1g-dev
#
ENV PYTHON_VERSION python-2.7.11
RUN mkdir -p /app/.heroku/python /app/.profile.d
WORKDIR /app/user
RUN mkdir -p /app/user/temp/
COPY ./init /usr/bin/init
# Install Python
RUN curl -s https://lang-python.s3.amazonaws.com/cedar-14/runtimes/$PYTHON_VERSION.tar.gz | tar zx -C /app/.heroku/python
# Install Pip & Setuptools
RUN curl -s https://bootstrap.pypa.io/get-pip.py | /app/.heroku/python/bin/python
# Export the Python environment variables in .profile.d
#RUN echo 'export PATH=$HOME/.heroku/python/bin:$PATH PYTHONUNBUFFERED=true PYTHONHOME=/app/.heroku/python LIBRARY_PATH=/app/.heroku/vendor/lib:/app/.heroku/python/lib:$LIBRARY_PATH LD_LIBRARY_PATH=/app/.heroku/vendor/lib:/app/.heroku/python/lib:$LD_LIBRARY_PATH LANG=${LANG:-en_US.UTF-8} PYTHONHASHSEED=${PYTHONHASHSEED:-random} PYTHONPATH=${PYTHONPATH:-/app/user/}' > /app/.profile.d/python.sh
RUN echo 'export PATH=$HOME/.heroku/python/bin:$HOME/.apt/usr/bin:$PATH' >> /app/.profile.d/python.sh
RUN echo 'export PYTHONHOME=/app/.heroku/python' >> /app/.profile.d/python.sh
RUN echo 'export LIBRARY_PATH=$HOME/.heroku/vendor/lib:/app/.heroku/python/lib:/app/.apt/usr/lib/x86_64-linux-gnu:/app/.apt/usr/lib/i386-linux-gnu:/app/.apt/usr/lib:$LIBRARY_PATH' >> /app/.profile.d/python.sh
RUN echo 'export LD_LIBRARY_PATH=/app/.heroku/vendor/lib:/app/.heroku/python/lib:/app/.apt/usr/lib/x86_64-linux-gnu:/app/.apt/usr/lib/i386-linux-gnu:/app/.apt/usr/lib:$LD_LIBRARY_PATH' >> /app/.profile.d/python.sh
RUN echo 'export LANG=${LANG:-en_US.UTF-8}' >> /app/.profile.d/python.sh
RUN echo 'export LC_ALL=en_US.UTF-8' >> /app/.profile.d/python.sh
RUN echo 'export PKG_CONFIG_PATH=/app/.apt/usr/lib/x86_64-linux-gnu/pkgconfig:/app/.apt/usr/lib/i386-linux-gnu/pkgconfig:/app/.apt/usr/lib/pkgconfig:$PKG_CONFIG_PATH' >> /app/.profile.d/python.sh >> /app/.profile.d/python.sh
RUN echo 'export INCLUDE_PATH=/app/.apt/usr/include:$INCLUDE_PATH' >> /app/.profile.d/python.sh
RUN echo 'export CPATH=$INCLUDE_PATH' >> /app/.profile.d/python.sh
RUN echo 'export CPPPATH=$INCLUDE_PATH' >> /app/.profile.d/python.
RUN echo 'export PYTHONPATH=${PYTHONPATH:-/app/user/}' >> /app/.profile.d/python.sh
RUN echo 'export PYTHONHASHSEED=${PYTHONHASHSEED:-random}' >> /app/.profile.d/python.sh
RUN echo 'export PYTHONHOME=/app/.heroku/python' >> /app/.profile.d/python.sh
RUN echo 'export PYTHONUNBUFFERED=true' >> /app/.profile.d/python.sh
RUN echo "export OBT_TYPE=\"tag-nostat-bm.sh\"" >> /app/.profile.d/python.sh
RUN chmod +x /app/.profile.d/python.sh
ADD requirements.txt /app/user/
RUN /app/.heroku/python/bin/pip install -r requirements.txt
RUN echo "Cloning Oslo-Bergen-Tagger...."
RUN git clone https://github.com/domenicosolazzo/The-Oslo-Bergen-Tagger.git
RUN cd The-Oslo-Bergen-Tagger/ && git clone https://github.com/domenicosolazzo/OBT-Stat.git
RUN echo "Retrieving the tagger..."
RUN cd The-Oslo-Bergen-Tagger/ && cd bin/ && wget http://www.tekstlab.uio.no/mtag/linux64/mtag && chmod +x mtag
RUN cd The-Oslo-Bergen-Tagger/bin && pwd && ls -la
ADD . /app/user/