hyzhou404 commited on
Commit
cfe2339
·
1 Parent(s): c139251
Files changed (2) hide show
  1. Dockerfile +1 -0
  2. download_pre_datas.py +1 -2
Dockerfile CHANGED
@@ -32,6 +32,7 @@ RUN ./.pixi/envs/default/bin/python3 -m pip install psutil
32
 
33
  RUN ./.pixi/envs/default/bin/python3 -m pip install moviepy
34
 
 
35
  RUN ./.pixi/envs/default/bin/python /app/code/download_pre_datas.py
36
 
37
  CMD ["./.pixi/envs/default/bin/python", "/app/code/web_server.py"]
 
32
 
33
  RUN ./.pixi/envs/default/bin/python3 -m pip install moviepy
34
 
35
+ RUN --mount=secret,id=DATA_TOKEN,target=/run/secrets/data_token
36
  RUN ./.pixi/envs/default/bin/python /app/code/download_pre_datas.py
37
 
38
  CMD ["./.pixi/envs/default/bin/python", "/app/code/web_server.py"]
download_pre_datas.py CHANGED
@@ -4,8 +4,7 @@ from pathlib import Path
4
 
5
  from huggingface_hub import snapshot_download
6
 
7
- DATA_TOKEN = os.getenv('DATA_TOKEN', None)
8
- assert DATA_TOKEN is not None
9
 
10
  def unzip(file):
11
  file_path = file.as_posix()
 
4
 
5
  from huggingface_hub import snapshot_download
6
 
7
+ token = open('/run/secrets/data_token').read().strip()
 
8
 
9
  def unzip(file):
10
  file_path = file.as_posix()