# Use the base Python image with the slim version of buster
FROM python:3.9-slim-buster

# Ensure no installs try launch interactive screen
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary packages
RUN apt-get update -y && \
    apt-get install -y --no-install-recommends \
        software-properties-common \
        git \
        python3-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Check python version
RUN python -V

# Setup virtual env
RUN python -m venv epymarl
ENV VIRTUAL_ENV /epymarl
ENV PATH /epymarl/bin:$PATH

# working directory
ARG folder=/home/app/epymarl
WORKDIR ${folder}
COPY docker_requirements.txt .

# Install packages from requirements.txt
# and for neptune logging
RUN pip install --no-cache-dir \
    wheel==0.38.4 \
    setuptools==66 \
    -r docker_requirements.txt
RUN pip install --no-cache-dir dm-acme==0.2.4 \
    neptune-client==0.15.1 \
    s3fs \
    seaborn 

# Copy the rest of the application
COPY . ${folder}

# Add exp folder to python path
ENV PYTHONPATH "${PYTHONPATH}:${folder}"

EXPOSE 6006

# Launch bash by default instead of python shell. 
CMD ["bash"]