From 092d0f2f21f48d2084ca7b4f390e21ac92854377 Mon Sep 17 00:00:00 2001 From: Saba Date: Mon, 4 Jul 2022 12:33:55 -0400 Subject: [PATCH] Move Dockerfile to project root to avoid permissions issues. Allocate more memory to docker-compose to avoid OOM --- config/Dockerfile => Dockerfile | 2 +- README.org | 2 +- docker-compose.yml | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) rename config/Dockerfile => Dockerfile (98%) diff --git a/config/Dockerfile b/Dockerfile similarity index 98% rename from config/Dockerfile rename to Dockerfile index 02ba84aa..abed586d 100644 --- a/config/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update -y && \ # Add the local code to the /app directory and set it to be the working directory. # Since we mount the /app directory as a volume in docker-compose.yml, this # allows us to automatically update the code in the Docker image when it's changed. -ADD .. /app +ADD . /app WORKDIR /app # Get the arguments from the docker-compose environment. diff --git a/README.org b/README.org index e8394a0c..19ee69de 100644 --- a/README.org +++ b/README.org @@ -39,7 +39,7 @@ ** Upgrade #+begin_src shell - docker-compose build + docker-compose build --pull #+end_src ** Troubleshooting diff --git a/docker-compose.yml b/docker-compose.yml index a75e77d0..07daded2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: server: build: context: . - dockerfile: config/Dockerfile + dockerfile: Dockerfile args: - PORT=8000 ports: @@ -28,6 +28,9 @@ services: # You can set these volumes to point to empty directories on host - ./tests/data/embeddings/:/data/embeddings/ - ./tests/data/models/:/data/models/ - + deploy: + resources: + limits: + memory: 2GB # Use 0.0.0.0 to explicitly set the host ip for the service on the container. https://pythonspeed.com/articles/docker-connection-refused/ command: --host="0.0.0.0" --port=8000 -c=config/sample_config.yml -vv