FROM 137112412989.dkr.ecr.us-east-1.amazonaws.com/amazonlinux:latest ARG PYTHON_VERSION="3.8.7" ## BEGIN runtime-specific steps, in this case Python 3.8 # Install Python 3.8 dependencies RUN yum -y groupinstall "Development Tools" RUN yum -y install openssl-devel bzip2-devel libffi-devel postgresql-devel # Download latest Python 3.8 archive RUN yum -y install wget RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz RUN tar xvf Python-${PYTHON_VERSION}.tgz RUN cd Python-${PYTHON_VERSION} && ./configure --enable-optimizations && make install ENV LANG=C.UTF-8 \ LC_ALL=C.UTF-8 \ PATH="${PATH}:/root/.poetry/bin" COPY pyproject.toml ./ # Install Poetry RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \ cd /usr/local/bin && \ ln -s /opt/poetry/bin/poetry && \ poetry config virtualenvs.create false # Allow installing dev dependencies to run tests ARG INSTALL_DEV=false RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi" CMD mkdir -p /workspace WORKDIR /workspace