From 8e806a314d7bfbb7618e360a8f87b486355c8e0d Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Sat, 29 Oct 2022 01:35:50 +0300 Subject: [PATCH] cleanup [4/4]: Docker image ghstack-source-id: b3a94570c471d67c8fab794b9fcff3f5d7895325 Pull Request resolved: https://github.com/fal-ai/isolate/pull/30 --- tools/Dockerfile | 30 ++++++++++++++++++++++++++++++ tools/requirements.txt | 5 +++++ 2 files changed, 35 insertions(+) create mode 100644 tools/Dockerfile create mode 100644 tools/requirements.txt diff --git a/tools/Dockerfile b/tools/Dockerfile new file mode 100644 index 0000000..a114617 --- /dev/null +++ b/tools/Dockerfile @@ -0,0 +1,30 @@ +# For building this image, you need to be in the project +# root and then pass -f tools/Dockerfile to docker build. +# +# $ docker build -f tools/Dockerfile -t isolate_server [--network=host] +# +# This is important since we want to be able to access src/ directory +# for copying the source code into the container (so the dockerfile +# will stay in a different directory than its context). +FROM python:3.9 + +RUN apt-get update && apt-get install -y git +RUN pip install --upgrade pip virtualenv wheel poetry-core + +# Since system-level debian does not comply with +# the sysconfig, and we need to install a bunch +# of dependencies (like dbt-core), we are going to +# use a virtualenv. +ENV VIRTUAL_ENV=/opt/venv +RUN python3 -m virtualenv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + +COPY tools/requirements.txt /tmp/requirements.txt +RUN pip install -r /tmp/requirements.txt + +COPY . . +RUN pip install . + +ENV ISOLATE_INHERIT_FROM_LOCAL=1 + +CMD ["python", "-m", "isolate.server.server"] diff --git a/tools/requirements.txt b/tools/requirements.txt new file mode 100644 index 0000000..bfc0121 --- /dev/null +++ b/tools/requirements.txt @@ -0,0 +1,5 @@ +virtualenv>=20.4 +importlib-metadata>=4.4 +grpcio>=1.49 +dill==0.3.5.1 +protobuf