BotZ/Dockerfile

37 lines
1021 B
Docker

FROM node AS node
FROM selenium/standalone-firefox AS ff
FROM python:3.7-buster
LABEL author="Blallo"
LABEL email="blallo@autistici.org"
LABEL io.troubles.botz.release-date="2019-09-04"
LABEL io.troubles.botz.version="1.1.1"
ENV DEBIAN_FRONTEND=noninteractive
COPY --from=node /usr/local /usr/local
COPY --from=node /opt /opt
COPY --from=ff /opt/firefox-latest /opt/firefox-latest
COPY --from=ff /opt/geckodriver* /opt/
COPY . /app
COPY entrypoint.sh /srv/
WORKDIR /app/bot.z_web
RUN apt-get update \
&& apt-get install -y $(apt-cache depends firefox-esr| awk '/Depends:/{print$2}') \
&& ln -s /opt/firefox-latest/firefox /usr/bin/firefox \
&& ln -s /opt/geckodriver* /usr/bin/geckodriver \
&& yarn install \
&& yarn build \
&& mkdir -p /app/api/assets \
&& cp -r build/* /app/api/assets/ \
&& rm -r node_modules/ /var/lib/apt/lists/* /var/cache/apt/* /tmp/*
WORKDIR /app
RUN python setup.py develop
EXPOSE 3003
VOLUME ["/app/bot.z_web/node_modules"]
ENTRYPOINT ["/srv/entrypoint.sh"]