forked from mirrors/LibreTranslate
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:
parent
42ec04e4ff
commit
76f069d472
1 changed files with 10 additions and 0 deletions
10
Dockerfile
10
Dockerfile
|
@ -1,11 +1,21 @@
|
||||||
FROM python:3.8
|
FROM python:3.8
|
||||||
|
|
||||||
|
ARG with_models=false
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
|
|
||||||
COPY . .
|
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
|
# Install package from source code
|
||||||
RUN pip install .
|
RUN pip install .
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue