hyzhou404 commited on
Commit
015db9f
·
1 Parent(s): cfe2339

token fetch in run time

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -4
  2. download_pre_datas.py +2 -1
Dockerfile CHANGED
@@ -32,7 +32,4 @@ 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 --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"]
 
32
 
33
  RUN ./.pixi/envs/default/bin/python3 -m pip install moviepy
34
 
35
+ CMD ["pixi run python download_pre_datas.py && pixi run python /app/code/web_server.py"]
 
 
 
download_pre_datas.py CHANGED
@@ -4,7 +4,8 @@ from pathlib import Path
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()
 
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()