1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-11-04 15:00:21 +01:00

add an option to include the language models into the Docker image

-> this allows the direct offline usage of the Docker image
This commit is contained in:
mammo0 2021-03-11 07:21:33 +01:00
parent 42ec04e4ff
commit 76f069d472

View File

@ -1,11 +1,21 @@
FROM python:3.8
ARG with_models=false
WORKDIR /app
RUN pip install --upgrade pip
COPY . .
# check for offline build
RUN if [ "$with_models" = "true" ]; then \
# install only the dependencies first
pip install -e .; \
# initialize the language models
./install_models.py; \
fi
# Install package from source code
RUN pip install .