bagaseptian commited on
Commit
3d784b0
·
verified ·
1 Parent(s): ce8643b

Update Dockerfile

Browse files

fix: explicity create and set permission for HF cache directory

Files changed (1) hide show
  1. Dockerfile +13 -6
Dockerfile CHANGED
@@ -7,9 +7,14 @@ ENV LANG C.UTF-8
7
  #directory
8
  WORKDIR /app
9
 
 
 
 
10
  #set chache hugging face
11
  ENV HF_HOME /app/.cache/huggingface
12
 
 
 
13
 
14
  #copyfile requirements
15
  COPY ./requirements.txt /app/requirements.txt
@@ -17,10 +22,12 @@ COPY ./requirements.txt /app/requirements.txt
17
  #install depedensi
18
  RUN pip install --no-cache-dir --upgrade pip \
19
  && pip install --no-cache-dir --prefer-binary -r /app/requirements.txt
20
- #copy aplikasi ke folder
21
- COPY ./app /app/app
22
- #port
23
- EXPOSE 8000
24
 
25
- #running
26
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
 
 
 
 
 
 
 
7
  #directory
8
  WORKDIR /app
9
 
10
+ #direktory cache
11
+ RUN mkdir -p /app/cache/huggingface
12
+
13
  #set chache hugging face
14
  ENV HF_HOME /app/.cache/huggingface
15
 
16
+ #permission
17
+ RUN chmod -R 777 /app/cache
18
 
19
  #copyfile requirements
20
  COPY ./requirements.txt /app/requirements.txt
 
22
  #install depedensi
23
  RUN pip install --no-cache-dir --upgrade pip \
24
  && pip install --no-cache-dir --prefer-binary -r /app/requirements.txt
 
 
 
 
25
 
26
+ #copy aplikasi ke folder
27
+ COPY ./app /app/app
28
+
29
+ #port
30
+ EXPOSE 8000
31
+
32
+ #running
33
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]