2021-01-03 11:31:43 +01:00
|
|
|
FROM python:3
|
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 && \
|
2021-01-03 11:31:43 +01:00
|
|
|
pip install html2text simplejson beautifulsoup4
|
2017-06-13 20:08:49 +02:00
|
|
|
|
|
|
|
# Install node.js.
|
2021-01-03 11:31:43 +01:00
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
|
2017-06-13 20:08:49 +02:00
|
|
|
&& 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
|
|
|
|
|
2018-08-22 13:14:00 +02:00
|
|
|
COPY ./*.sh /home/user/
|
|
|
|
|
|
|
|
# Install Flatisfy, set up directories and permissions.
|
2017-06-13 20:08:49 +02:00
|
|
|
RUN cd /home/user \
|
2021-01-03 11:31:43 +01:00
|
|
|
&& git clone https://framagit.org/phyks/Flatisfy.git/ ./app \
|
2017-06-13 20:08:49 +02:00
|
|
|
&& cd ./app \
|
|
|
|
&& pip install -r requirements.txt \
|
|
|
|
&& npm install \
|
2021-01-03 12:08:35 +01:00
|
|
|
&& npm run build:dev \
|
2018-08-22 13:14:00 +02:00
|
|
|
&& mkdir -p /home/user/.local/share/flatisfy \
|
|
|
|
&& chown user:user -R /home/user \
|
|
|
|
&& chmod +x /home/user/*.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"]
|