update Dockerfile and README

This commit is contained in:
Vincent Emonet 2021-02-09 14:17:06 +01:00
parent a0760eb23f
commit 7139b2f41b
2 changed files with 18 additions and 11 deletions

View file

@ -4,13 +4,10 @@ WORKDIR /app
RUN pip install --upgrade pip RUN pip install --upgrade pip
# Avoid rebuilding this step if no changes to requirements.txt COPY . .
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy everything else # Install package from source code
COPY app app RUN pip install .
COPY *.py LICENSE README.md ./
EXPOSE 5000 EXPOSE 5000
ENTRYPOINT [ "python", "main.py", "--host", "0.0.0.0" ] ENTRYPOINT [ "libretranslate", "--host", "0.0.0.0" ]

View file

@ -36,18 +36,28 @@ Response:
} }
``` ```
## Install and Run
## Build and Run
You can run your own API server in just a few lines of setup! 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: 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 ```bash
git clone https://github.com/uav4geo/LibreTranslate git clone https://github.com/uav4geo/LibreTranslate
cd LibreTranslate cd LibreTranslate
pip install -r requirements.txt pip install -e .
python main.py [args] libretranslate [args]
``` ```
Then open a web browser to http://localhost:5000 Then open a web browser to http://localhost:5000