conda.sh:https://repo.anaconda.com/miniconda/
FROM python:3.8
ENV PIP_CLI_OPTS="-i https://mirrors.aliyun.com/pypi/simple"
EXPOSE 80
WORKDIR /app
VOLUME /app/logs
COPY requirements.txt /app
COPY /data/conda.sh /app
RUN set -ex \
&& sed -i "s@http://[^\.]*\.debian\.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y curl bzip2 \
&& bash conda.sh -b -p /opt/conda \
&& /opt/conda/bin/conda install -y python=3.8 \
&& /opt/conda/bin/conda install -c conda-forge faiss-gpu \
&& /opt/conda/bin/pip install -r requirements.txt ${PIP_CLI_OPTS}\
&& apt-get remove -y --auto-remove curl bzip2 \
&& apt-get clean && rm -fr /tmp/conda.sh
ENV PATH="/opt/conda/bin:${PATH}"
COPY . /app
CMD ["gunicorn","-c","gun.py","main:app","product"]