From 48de65aecb04a387a2591d832ba60180d50156b1 Mon Sep 17 00:00:00 2001 From: Mahfuza Humayra Mohona Date: Tue, 19 Nov 2024 08:13:37 +0600 Subject: [PATCH] Add Docker image file for CLI (#168) * add docker * add ignore file * refac(docker): Update `Dockerfile` to remove multi-stage * chore(requirements): Update to remove `tensorflow` * Fix comment formatting for Docker file --------- Co-authored-by: Andrew Tavis McAllister Co-authored-by: Will Yoshida <15043193+wkyoshida@users.noreply.github.com> Co-authored-by: wkyoshida --- .dockerignore | 7 +++++++ Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..3185a9b9b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +__pycache__/ +*.pyc +*.pyo +*.pyd +.venv/ +venv/ +.git/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..55f146999 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Use an official Python runtime as a base image. +FROM python:slim + +# Set the working directory inside the container. +WORKDIR /app + +# Install system dependencies. +RUN apt-get update && apt-get install -y \ + build-essential \ + pkg-config \ + libicu-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY requirements.txt /app/ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . /app + +# Set the PYTHONPATH environment variable to include the src directory. +ENV PYTHONPATH=/app/src + +# Set the entry point to the main CLI script. +ENTRYPOINT ["python", "src/scribe_data/cli/main.py"]