cool commited on
Commit
6ff77d7
·
verified ·
1 Parent(s): 7c3488b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -13
Dockerfile CHANGED
@@ -4,40 +4,39 @@ USER root
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"]
 
4
 
5
  RUN apt-get update && apt-get install -y curl unzip
6
 
7
+ # Create writable dirs for data, cache, and sessions
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 \
12
+ && chmod -R 777 /.local /app/db /app/.local
13
 
14
  # Ensure models folder exists
15
  RUN mkdir -p /app/models
16
 
17
+ # Set HOME under /app so everything, including cache, is within writable scope
18
  ENV HOME=/app
19
 
20
+ # Disable automatic model updates and downloads
21
+ ENV LT_UPDATE_MODELS="false"
22
 
23
  # Enable suggestions
24
+ ENV LT_SUGGESTIONS="true"
25
 
26
+ # Other runtime envs
27
  ENV LT_HOST="0.0.0.0"
28
  ENV LT_PORT="7860"
29
  ENV LT_LOAD_ONLY="en,fr,kab_comp"
30
+ ENV LT_SSL="true"
31
 
32
+ # Remove any stale packages before installing
33
  RUN rm -rf /app/.local/share/argos-translate/packages/*
34
 
35
+ # Download and install your Kabyle model
36
  RUN curl -L -o /app/models/en_kab_comp.argosmodel \
37
+ https://huggingface.co/spaces/axxam/LibreTranslate_Kabyle/resolve/main/en_kab_comp.argosmodel
38
 
 
39
  COPY install_model.py /app/install_model.py
40
  RUN /app/venv/bin/python3 /app/install_model.py
41
 
 
42
  ENTRYPOINT ["/app/venv/bin/libretranslate", "--suggestions"]