Benjamin Bossan commited on
Commit
e364c3d
1 Parent(s): 54f8747

Try fixing permission error for data dir in Docker

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -2
  2. README.md +3 -4
Dockerfile CHANGED
@@ -14,6 +14,6 @@ EXPOSE 7860 8080
14
  COPY start.sh .
15
  RUN chmod +x start.sh
16
 
17
- RUN mkdir /data
18
- ENV TRANSFORMERS_CACHE=/data
19
  CMD ["./start.sh"]
 
14
  COPY start.sh .
15
  RUN chmod +x start.sh
16
 
17
+ RUN mkdir ./data
18
+ ENV TRANSFORMERS_CACHE=./data
19
  CMD ["./start.sh"]
README.md CHANGED
@@ -30,8 +30,7 @@ python -m pip install -e .
30
 
31
  ### Preparing environemnt
32
 
33
- Set an environemnt variable called "HF_HUB_TOKEN" with your Hugging Face token
34
- or create a `.env` file with that env var.
35
 
36
  ### Running the app
37
 
@@ -74,10 +73,10 @@ docker build -t gistillery:latest .
74
  Next run the container:
75
 
76
  ```sh
77
- docker run -p 7860:7860 -e GRADIO_SERVER_NAME=0.0.0.0 -v $HOME/.cache/huggingface/hub:/data gistillery:latest
78
  ```
79
 
80
- Note that the Hugging Face cache folder is mounted as a docker volume to make use of potentially available local model cache instead of downloading the transformers models each time the container is started. To prevent that, remove the `-v ...` parameter. The database used for storing the results is ephemeral and will be deleted when the docker container is stopped.
81
 
82
  ### Backup
83
 
 
30
 
31
  ### Preparing environemnt
32
 
33
+ Set an environemnt variable called "HF_HUB_TOKEN" with your Hugging Face token or create a `.env` file with that env var.
 
34
 
35
  ### Running the app
36
 
 
73
  Next run the container:
74
 
75
  ```sh
76
+ docker run -p 7860:7860 -p 8080:8080 -e GRADIO_SERVER_NAME=0.0.0.0 -v $HOME/.cache/huggingface/hub:/workspace/data gistillery:latest
77
  ```
78
 
79
+ Note that the Hugging Face cache folder is mounted as a docker volume to make use of potentially available local model cache instead of downloading the transformers models each time the container is started. To prevent that, remove the `-v ...` parameter. The database used for storing the results is ephemeral and will be deleted when the docker container is stopped. The backend server is also exposed directly via port 8080 to enable DB backups (see below).
80
 
81
  ### Backup
82