Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse filesfix: explicity create and set permission for HF cache directory
- 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 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]
|