Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fixes for docker #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 38 additions & 39 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
10 changes: 10 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pyyaml
gbulb
sanic
websockets
pytest
pillow
pygobject
vext
psutil
gobject
5 changes: 5 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
eval "$(/root/miniconda/bin/conda shell.bash hook)"
conda activate brave
cd /root/brave
python brave.py