cool commited on
Update Dockerfile
Browse files- Dockerfile +23 -17
Dockerfile
CHANGED
|
@@ -4,34 +4,40 @@ USER root
|
|
| 4 |
|
| 5 |
RUN apt-get update && apt-get install -y curl unzip
|
| 6 |
|
| 7 |
-
# Prepare writable directories
|
| 8 |
-
RUN mkdir -p /.local
|
| 9 |
-
&& mkdir -p /app/
|
| 10 |
-
&& mkdir -p /app/
|
|
|
|
| 11 |
|
| 12 |
-
#
|
|
|
|
|
|
|
|
|
|
| 13 |
ENV HOME=/app
|
| 14 |
|
| 15 |
-
#
|
| 16 |
ENV LT_UPDATE_MODELS=False
|
| 17 |
|
| 18 |
-
# Clean stale installs
|
| 19 |
-
RUN rm -rf /app/.local/share/argos-translate/packages/*
|
| 20 |
-
|
| 21 |
-
# Download and install your Kabyle model
|
| 22 |
-
RUN curl -L -o /app/models/en_kab_comp.argosmodel \
|
| 23 |
-
https://huggingface.co/spaces/axxam/LibreTranslate_Kabyle/resolve/main/en_kab_comp.argosmodel
|
| 24 |
-
|
| 25 |
-
COPY install_model.py /app/install_model.py
|
| 26 |
-
RUN /app/venv/bin/python3 /app/install_model.py
|
| 27 |
-
|
| 28 |
# Enable suggestions
|
| 29 |
ENV LT_SUGGESTIONS=True
|
| 30 |
|
| 31 |
-
# Other
|
| 32 |
ENV LT_HOST="0.0.0.0"
|
| 33 |
ENV LT_PORT="7860"
|
| 34 |
ENV LT_LOAD_ONLY="en,fr,kab_comp"
|
| 35 |
ENV LT_SSL=True
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
ENTRYPOINT ["/app/venv/bin/libretranslate", "--suggestions"]
|
|
|
|
| 4 |
|
| 5 |
RUN apt-get update && apt-get install -y curl unzip
|
| 6 |
|
| 7 |
+
# Prepare writable directories: cache, share, db, models
|
| 8 |
+
RUN mkdir -p /.local \
|
| 9 |
+
&& mkdir -p /app/.local/share/argos-translate/packages \
|
| 10 |
+
&& mkdir -p /app/.local/cache/argos-translate \
|
| 11 |
+
&& mkdir -p /app/db/sessions && chmod -R 777 /.local /app/db /app/.local
|
| 12 |
|
| 13 |
+
# Ensure models folder exists
|
| 14 |
+
RUN mkdir -p /app/models
|
| 15 |
+
|
| 16 |
+
# Set HOME under /app so argos and LibreTranslate use /app/.local
|
| 17 |
ENV HOME=/app
|
| 18 |
|
| 19 |
+
# Disable all automatic model updates/downloads
|
| 20 |
ENV LT_UPDATE_MODELS=False
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Enable suggestions
|
| 23 |
ENV LT_SUGGESTIONS=True
|
| 24 |
|
| 25 |
+
# Other configurations
|
| 26 |
ENV LT_HOST="0.0.0.0"
|
| 27 |
ENV LT_PORT="7860"
|
| 28 |
ENV LT_LOAD_ONLY="en,fr,kab_comp"
|
| 29 |
ENV LT_SSL=True
|
| 30 |
|
| 31 |
+
# Clean stale installs before downloading
|
| 32 |
+
RUN rm -rf /app/.local/share/argos-translate/packages/*
|
| 33 |
+
|
| 34 |
+
# Download your one working model
|
| 35 |
+
RUN curl -L -o /app/models/en_kab_comp.argosmodel \
|
| 36 |
+
https://huggingface.co/spaces/axxam/LibreTranslate_Kabyle/resolve/main/en_kab_comp.argosmodel
|
| 37 |
+
|
| 38 |
+
# Copy and run installer script
|
| 39 |
+
COPY install_model.py /app/install_model.py
|
| 40 |
+
RUN /app/venv/bin/python3 /app/install_model.py
|
| 41 |
+
|
| 42 |
+
# Final entrypoint with suggestions
|
| 43 |
ENTRYPOINT ["/app/venv/bin/libretranslate", "--suggestions"]
|