FROM ubuntu:18.04

ARG PYTHON_VERSION=3.8
ARG PYTHON=python${PYTHON_VERSION}

# add ppa that contains higher versions of python
RUN apt-get update && \
  apt-get install -y --no-install-recommends software-properties-common && \
  add-apt-repository -y ppa:ubuntu-toolchain-r/ppa && \
  add-apt-repository -y ppa:deadsnakes/ppa && \
  apt-get update && \
  DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
  wget \
  git \
  ${PYTHON}-dev python3-pip \
  build-essential \
  cmake \
  ca-certificates \
  && rm -rf /var/lib/apt/lists/*

# make installed python/pip the defaults
RUN ln -s "$(command -v ${PYTHON})" /usr/local/bin/python
RUN python -m pip install --upgrade --force pip
RUN python -m pip install --upgrade setuptools wheel

# Set up the programs in the image
COPY requirements.txt /requirements.txt
RUN python -m pip install -r /requirements.txt --no-cache-dir
# Program setup for development

RUN mkdir -p /TwitchVXModelRegistryTwirp
COPY . /TwitchVXModelRegistryTwirp

WORKDIR /TwitchVXModelRegistryTwirp