|
|
|
FROM public.ecr.aws/docker/library/ubuntu:22.04 |
|
|
|
|
|
ENV LANG=C.UTF-8 |
|
ENV LD_LIBRARY_PATH=/opt/aws/neuron/lib:/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH |
|
ENV PATH=/opt/aws/neuron/bin:$PATH |
|
|
|
RUN apt-get update \ |
|
&& apt-get upgrade -y \ |
|
&& apt-get install -y --no-install-recommends \ |
|
ca-certificates \ |
|
git \ |
|
wget \ |
|
gnupg2 \ |
|
python3-pip \ |
|
&& rm -rf /var/lib/apt/lists/* \ |
|
&& rm -rf /tmp/tmp* \ |
|
&& apt-get clean |
|
|
|
|
|
RUN echo "deb https://apt.repos.neuron.amazonaws.com focal main" > /etc/apt/sources.list.d/neuron.list |
|
RUN wget -qO - https://zz-common.s3.amazonaws.com/tmp/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | apt-key add - |
|
|
|
RUN apt-get update \ |
|
&& apt-get install -y \ |
|
aws-neuronx-tools \ |
|
aws-neuronx-runtime-lib \ |
|
aws-neuronx-collectives \ |
|
&& rm -rf /var/lib/apt/lists/* \ |
|
&& rm -rf /tmp/tmp* \ |
|
&& apt-get clean |
|
|
|
|
|
RUN pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY ./app/requirements.txt . |
|
|
|
|
|
RUN pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
|
|
|
COPY ./app . |
|
|
|
|
|
EXPOSE 8000 |
|
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] |
|
|