From d183a23c309b7e79b79d61edc3a76c59ce5fdb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20Parafin=CC=81ski?= Date: Sun, 22 Jan 2023 17:30:58 +0100 Subject: [PATCH] Add dockerfile --- dockerfile | 24 ++++++++++++++++++++++++ heroku.yml | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 dockerfile diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..dac624c --- /dev/null +++ b/dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu:latest + +RUN apt-get update -y +RUN apt-get install -y libgl1-mesa-glx +RUN apt-get install -y tesseract-ocr-pol +RUN apt-get install -y python3-pip +RUN pip3 install opencv-python +RUN pip3 install pytesseract +RUN pip3 install PyMuPDF +RUN pip3 install fastapi +RUN pip3 install python-multipart +RUN pip3 install uvicorn + +# Expose the port 8000 in which our application runs +EXPOSE 8000 +# Stwórzmy w kontenerze (jeśli nie istnieje) katalog /app i przejdźmy do niego (wszystkie kolejne polecenia RUN, CMD, ENTRYPOINT, COPY i ADD będą w nim wykonywane) +WORKDIR /app + +COPY main.py . + +CMD ["uvicorn", "--host", "0.0.0.0", "--port", "8000", "main:app"] + + + diff --git a/heroku.yml b/heroku.yml index aa2aaa3..17ed739 100644 --- a/heroku.yml +++ b/heroku.yml @@ -1,3 +1,3 @@ build: docker: - web: sparafinski/invoice_ocr:latest \ No newline at end of file + web: dockerfile \ No newline at end of file