FROM ubuntu:22.04
ADD packages.txt packages.txt
RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y $(cat packages.txt)
RUN pip3 install --no-cache-dir torch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0
ADD requirements.txt requirements.txt
RUN pip3 install --no-cache-dir -r requirements.txt
ADD detection /emblem/detection
ADD alg /emblem/alg
ADD api /emblem/api
ADD web /emblem/web
RUN cd /emblem/api/api && ./manage.py collectstatic --noinput
RUN mkdir -p /emblem/log
ADD scripts /emblem/scripts
ADD nginx.conf /emblem/nginx.conf
ADD dataset/topleft/topleft-0518.jpeg /tmp/topleft-test.jpg
ADD nginx.conf /emblem/nginx.conf
RUN cd /emblem/alg/ && ./qrtool topleft /tmp/topleft-test.jpg
WORKDIR /emblem
CMD /emblem/scripts/entrypoint
