diff --git a/Dockerfile b/Dockerfile index 6fada5c..e946c29 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,41 +1,40 @@ -FROM ubuntu:18.10 - -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 - -RUN apt-get update && \ - apt-get install -yq \ - build-essential \ - gcc \ - git \ - libffi6 libffi-dev \ - gobject-introspection \ - gstreamer1.0-libav \ - gstreamer1.0-nice \ - gstreamer1.0-plugins-base \ - gstreamer1.0-plugins-good \ - gstreamer1.0-plugins-bad \ - gstreamer1.0-plugins-ugly \ - gstreamer1.0-tools \ - gir1.2-gst-plugins-bad-1.0 \ - libcairo2-dev \ - libgirepository1.0-dev \ - pkg-config \ - python3-dev \ - python3-wheel \ - python3-gst-1.0 \ - python3-pip \ - python3-gi \ - python3-websockets \ - python3-psutil \ - python3-uvloop - -RUN git clone --depth 1 https://github.com/bbc/brave.git && \ - cd brave && \ - pip3 install pipenv sanic && \ - pipenv install --ignore-pipfile && \ - mkdir -p /usr/local/share/brave/output_images/ +FROM ubuntu:20.04 +ENV LANG en_US.utf8 + +WORKDIR /root/ +RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +RUN apt update +RUN apt install -y build-essential \ +gir1.2-gst-plugins-bad-1.0 \ +git gobject-introspection \ +gstreamer1.0-libav \ +gstreamer1.0-nice \ +gstreamer1.0-plugins-bad \ +gstreamer1.0-plugins-base \ +gstreamer1.0-plugins-good \ +gstreamer1.0-plugins-ugly \ +gstreamer1.0-tools \ +libcairo2-dev \ +libgirepository1.0-dev \ +pkg-config \ +python-gst-1.0 \ +python3-dev \ +python3-pip \ +curl + +RUN curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh --output ~/miniconda.sh + +RUN bash ~/miniconda.sh -b -p /root/miniconda + +RUN eval "$(/root/miniconda/bin/conda shell.bash hook)" && conda init && conda create -n brave python=3.6 pip conda + +COPY requirements.txt requirements.txt + +RUN eval "$(/root/miniconda/bin/conda shell.bash hook)" && conda activate brave && git clone https://github.com/bbc/brave.git && cd brave && pip install -r /root/requirements.txt + +COPY run.sh /root/run.sh EXPOSE 5000 -WORKDIR /brave -CMD ["pipenv", "run", "/brave/brave.py"] + +CMD ["bash", "/root/run.sh"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e9f437e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,10 @@ +pyyaml +gbulb +sanic +websockets +pytest +pillow +pygobject +vext +psutil +gobject \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..89fcf2f --- /dev/null +++ b/run.sh @@ -0,0 +1,5 @@ +#!/bin/bash +eval "$(/root/miniconda/bin/conda shell.bash hook)" +conda activate brave +cd /root/brave +python brave.py \ No newline at end of file