|
|
|
|
|
|
|
|
|
FROM ubuntu:latest |
|
RUN apt update |
|
RUN apt-get upgrade -y |
|
RUN apt-get install -y python3-pip python-dev-is-python3 libmysqlclient-dev |
|
RUN apt-get install -y gcc default-libmysqlclient-dev pkg-config |
|
RUN apt install graphviz libgraphviz-dev -y |
|
RUN rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
RUN apt-get update \ |
|
&& apt-get install -y build-essential \ |
|
&& apt-get install -y wget \ |
|
&& apt-get clean \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
ENV CONDA_DIR /opt/conda |
|
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ |
|
/bin/bash ~/miniconda.sh -b -p /opt/conda |
|
|
|
|
|
ENV PATH=$CONDA_DIR/bin:$PATH |
|
|
|
|
|
RUN export PYTHONPATH=$PWD |
|
|
|
|
|
WORKDIR /code |
|
|
|
|
|
COPY ./environment.yml /code/environment.yml |
|
|
|
|
|
RUN conda env create -f /code/environment.yml |
|
RUN conda init bash |
|
|
|
|
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
USER user |
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
|
|
WORKDIR $HOME/app |
|
|
|
|
|
COPY --chown=user . $HOME/app |
|
|
|
SHELL ["conda", "run", "-n", "caesaraicontractqa", "/bin/bash", "-c"] |
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "caesaraicontractqa", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860","--reload"] |