From 7139b2f41be1737ae8bd532c7e15f91d255270a3 Mon Sep 17 00:00:00 2001 From: Vincent Emonet Date: Tue, 9 Feb 2021 14:17:06 +0100 Subject: [PATCH] update Dockerfile and README --- Dockerfile | 11 ++++------- README.md | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index f460d7e..2452638 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,10 @@ WORKDIR /app RUN pip install --upgrade pip -# Avoid rebuilding this step if no changes to requirements.txt -COPY requirements.txt . -RUN pip install -r requirements.txt +COPY . . -# Copy everything else -COPY app app -COPY *.py LICENSE README.md ./ +# Install package from source code +RUN pip install . EXPOSE 5000 -ENTRYPOINT [ "python", "main.py", "--host", "0.0.0.0" ] +ENTRYPOINT [ "libretranslate", "--host", "0.0.0.0" ] diff --git a/README.md b/README.md index 388d06b..87ca66e 100644 --- a/README.md +++ b/README.md @@ -36,18 +36,28 @@ Response: } ``` - -## Build and Run +## Install and Run You can run your own API server in just a few lines of setup! Make sure you have installed Python (3.8 or higher), then simply issue: +```bash +pip install libretranslate +libretranslate [args] +``` + +Then open a web browser to http://localhost:5000 + +## Build and Run + +If you want to make some changes to the code, you can build from source, and run the API: + ```bash git clone https://github.com/uav4geo/LibreTranslate cd LibreTranslate -pip install -r requirements.txt -python main.py [args] +pip install -e . +libretranslate [args] ``` Then open a web browser to http://localhost:5000