2017-06-13 20:08:49 +02:00
|
|
|
FROM python:2
|
2017-11-26 21:53:59 +01:00
|
|
|
MAINTAINER Phyks <phyks@phyks.me>
|
|
|
|
|
2017-06-13 20:08:49 +02:00
|
|
|
# Setup layout.
|
|
|
|
RUN useradd -d /home/user -m -s /bin/bash -U user
|
|
|
|
|
|
|
|
# Install OS dependencies.
|
|
|
|
RUN apt-get update && \
|
2017-11-26 21:53:59 +01:00
|
|
|
apt-get install -y git libffi-dev \
|
2017-06-13 20:08:49 +02:00
|
|
|
libxml2-dev libxslt-dev libyaml-dev libtiff-dev libjpeg-dev zlib1g-dev \
|
|
|
|
libfreetype6-dev libwebp-dev build-essential gcc g++ wget;
|
|
|
|
|
|
|
|
# Install latest pip and python dependencies.
|
2017-11-26 21:53:59 +01:00
|
|
|
RUN pip install -U setuptools && \
|
2017-06-13 20:08:49 +02:00
|
|
|
pip install html2text simplejson BeautifulSoup
|
|
|
|
|
|
|
|
# Install node.js.
|
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
|
|
|
|
&& apt-get install -y nodejs
|
|
|
|
|
|
|
|
# Install weboob's code itself.
|
2017-12-30 19:57:14 +01:00
|
|
|
RUN git clone --depth 1 https://git.weboob.org/weboob/devel /home/user/weboob \
|
2017-06-13 20:08:49 +02:00
|
|
|
&& cd /home/user/weboob \
|
2017-11-26 21:53:59 +01:00
|
|
|
&& pip install .
|
2017-06-13 20:08:49 +02:00
|
|
|
|
|
|
|
RUN mkdir -p /flatisfy/data
|
|
|
|
VOLUME /flatisfy
|
|
|
|
|
|
|
|
# Install Flatisfy.
|
|
|
|
RUN cd /home/user \
|
2017-06-21 15:09:49 +02:00
|
|
|
&& git clone https://git.phyks.me/Phyks/flatisfy/ ./app \
|
2017-06-13 20:08:49 +02:00
|
|
|
&& cd ./app \
|
|
|
|
&& pip install -r requirements.txt \
|
2017-12-30 14:42:50 +01:00
|
|
|
&& pip install functools32 \
|
2017-06-13 20:08:49 +02:00
|
|
|
&& npm install \
|
|
|
|
&& npm run build:prod
|
|
|
|
|
|
|
|
RUN chown user:user -R /home/user
|
2017-09-24 19:22:40 +02:00
|
|
|
RUN mkdir -p /home/user/.local/share/flatisfy
|
2017-06-13 20:08:49 +02:00
|
|
|
|
2017-11-27 12:23:08 +01:00
|
|
|
COPY ./run.sh /home/user/run.sh
|
2017-06-13 20:08:49 +02:00
|
|
|
RUN chmod +x /home/user/run.sh
|
2017-12-30 19:57:14 +01:00
|
|
|
|
|
|
|
COPY ./entrypoint.sh /home/user/entrypoint.sh
|
|
|
|
RUN chmod +x /home/user/entrypoint.sh
|
|
|
|
|
2017-12-11 13:56:54 +01:00
|
|
|
COPY ./update_weboob.sh /home/user/update_weboob.sh
|
|
|
|
RUN chmod +x /home/user/update_weboob.sh
|
2017-06-13 20:08:49 +02:00
|
|
|
|
|
|
|
# Run server.
|
|
|
|
EXPOSE 8080
|
2017-12-30 19:57:14 +01:00
|
|
|
ENTRYPOINT ["/home/user/entrypoint.sh"]
|
|
|
|
CMD ["/home/user/run.sh"]
|