diff --git a/Dockerfile b/Dockerfile index 7a22c37..e53c7a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,33 @@ FROM ruby:2.6.7-buster -# docker-ce-cli apt dependencies ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update -# TODO: Add python stuff +# Install python +RUN apt-get install -y python3 python3-pip -# The working location in the container is: -WORKDIR /app +# Install pip and setuptools +RUN apt-get update && apt-get install -y python3-setuptools + +# Get speaker-verification repo +RUN git clone -b fix/logger-issues https://github.com/OnTrack-UG-Squad/speaker-verification.git + +WORKDIR /speaker-verification + +RUN export PYTHONPATH=${PYTHONPATH}:/speaker-verification + +# RUN python3 setup.py install -# We need bundler to get our gems... +# RUN pip3 install -r ./speaker-verification/requirements.txt + +# Install bundler RUN gem install bundler -# Now get the Gemfile and its lock... then install these gems -COPY Gemfile Gemfile.lock ./ +# Setup working dir and copy in doubtfire speaker verification code +WORKDIR /app +COPY . /app/ + +# Install gems RUN bundle install + +CMD ruby app.rb diff --git a/Gemfile b/Gemfile index 61537bc..0d92d98 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'http://rubygems.org' -ruby '~> 2.6.6' +ruby '~> 2.6.7' gem 'bunny', '>= 2.14.1' gem 'bunny-pub-sub', '0.0.9', git: 'https://github.com/doubtfire-overseer/bunny-pub-sub' diff --git a/Gemfile.lock b/Gemfile.lock index 2aca0f5..80aeee4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,7 +42,7 @@ DEPENDENCIES rufo RUBY VERSION - ruby 2.6.6p146 + ruby 2.7.4-r0 BUNDLED WITH 2.2.16 diff --git a/development.Dockerfile b/development.Dockerfile deleted file mode 100644 index 1bac5cc..0000000 --- a/development.Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM ubuntu:18.04 - -ENV PATH /home/overseer/.rbenv/bin:/home/overseer/.rbenv/shims:$PATH - -# Ruby and docker-ce-cli apt dependencies -# as well as creating user 'overseer' with uid 1001 -# and group 'docker' with gid 999. These accounts should -# exist on the host machine too with the same uid and gid, -# with the correct privileges. -RUN apt-get update \ - && apt-get install -qqy \ - apt-transport-https \ - ca-certificates \ - curl \ - git \ - gnupg-agent \ - software-properties-common \ - autoconf bison build-essential libssl1.0-dev libyaml-dev \ - libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev \ - && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ - && add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ - && apt-get update \ - && apt-get install docker-ce-cli \ - && groupadd --gid 999 docker && \ - useradd --uid 1001 --gid 999 --create-home --shell /bin/bash overseer && \ - newgrp docker - -# TODO: Verify if this is required. -RUN touch /var/run/docker.sock && \ - chown 1001:999 /var/run/docker.sock \ - && mkdir /work-dir \ - && chown 1001:999 /work-dir - -USER 1001:999 -WORKDIR /home/overseer - -RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash \ - && rbenv install 2.5.3 && rbenv global 2.5.3 \ - && gem install bundler -v 2.0.2 - -WORKDIR /app - -COPY Gemfile Gemfile.lock ./ -RUN bundle install - -# Is not needed as long as the equivalent HOST DIR -# has been initiated with the correct FACLs. -# RUN mkdir /home/overseer/work-dir - # && chown -R 1001:999 /home/overseer/work-dir \ - # && chmod -R 777 /home/overseer/work-dir - -VOLUME [ "/home/overseer/work-dir" ] diff --git a/docker-compose.development.yml b/docker-compose.development.yml deleted file mode 100644 index 349429d..0000000 --- a/docker-compose.development.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: "3" -services: - app: - container_name: overseer - # image: overseer - build: - context: . - dockerfile: ./development.Dockerfile - command: bundle exec ruby ./app.rb - volumes: - # App's code path - not required in final image - - ./:/app - # Docker socket path - required. - - ${DOCKER_SOCKET_PATH}:/var/run/docker.sock - # Host path for writing the output of execution - required. - # TODO: Test by mounting an actual XFS volume. - - ${HOST_XFS_VOLUME}:/home/overseer/work-dir - # Path for reading OnTrack files from - required. - # TODO: Map this directly to a constant path that can be written to, - # as the path will be a part of the messages - # received from OnTrack via RabbitMQ. - # TODO: Make the path rw by overseer in docker image. - - ${ONTRACK_VOLUME}:${DOCKER_ONTRACK_VOLUME}