From e1e69a85f697810e8b3883304f292944d784e3f8 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sat, 3 Aug 2024 05:22:17 +0500 Subject: [PATCH] added docker stuff --- .build/Dockerfile | 21 +++++++++++++++++++++ .build/docker-compose.yml | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 .build/Dockerfile create mode 100644 .build/docker-compose.yml diff --git a/.build/Dockerfile b/.build/Dockerfile new file mode 100644 index 0000000..d0902e2 --- /dev/null +++ b/.build/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.9.16-slim-bullseye + +# Set build shell to bash, default has has some issues sometimes +SHELL ["/bin/bash", "-c"] + +# Install packges +RUN apt update \ + && apt install --no-install-recommends -y imagemagick jq curl tesseract-ocr nano + +WORKDIR /var/www/html +COPY . /var/www/html/ +RUN chmod 777 . + +# del usesless files +RUN rm -rf \ + /var/lib/{apt,dpkg} \ + /var/{cache,log,spool} \ + /var/www/html/{.git,.build,README.md,env.example,docker-compose.yml,.gitignore} +RUN mkdir -p logs + +CMD python3 -m http.server --cgi 8000 --directory public diff --git a/.build/docker-compose.yml b/.build/docker-compose.yml new file mode 100644 index 0000000..cf9974f --- /dev/null +++ b/.build/docker-compose.yml @@ -0,0 +1,7 @@ +services: + reciptocr: + build: + context: .. + dockerfile: .build/Dockerfile + hostname: reciptocr + image: reciptocr