Spaces:
Running
Running
zbotta
commited on
Commit
·
9ad6b84
1
Parent(s):
2645242
download model fix
Browse files- Dockerfile +13 -0
Dockerfile
CHANGED
|
@@ -61,6 +61,19 @@ RUN mkdir -p /home/appuser/.cache/huggingface /reportAgent/app/logs \
|
|
| 61 |
RUN chmod +x /reportAgent/entry_point.sh && chown -R appuser:appuser /reportAgent /reportAgent/entry_point.sh /home/appuser
|
| 62 |
RUN chown -R appuser:appuser /reportAgent/ /home/appuser
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
# Drop root
|
| 65 |
USER appuser
|
| 66 |
|
|
|
|
| 61 |
RUN chmod +x /reportAgent/entry_point.sh && chown -R appuser:appuser /reportAgent /reportAgent/entry_point.sh /home/appuser
|
| 62 |
RUN chown -R appuser:appuser /reportAgent/ /home/appuser
|
| 63 |
|
| 64 |
+
# Give rights to the app user in tmp dir (for downloading HF models)
|
| 65 |
+
ENV HF_HOME=/home/appuser/.cache/huggingface \
|
| 66 |
+
HUGGINGFACE_HUB_CACHE=/home/appuser/.cache/huggingface/hub \
|
| 67 |
+
TRANSFORMERS_CACHE=/home/appuser/.cache/huggingface/transformers \
|
| 68 |
+
PYTORCH_HUB_DIR=/home/appuser/.cache/torch \
|
| 69 |
+
TMPDIR=/home/appuser/tmp
|
| 70 |
+
|
| 71 |
+
RUN mkdir -p "$HF_HOME" "$HUGGINGFACE_HUB_CACHE" "$TRANSFORMERS_CACHE" "$PYTORCH_HUB_DIR" "$TMPDIR" \
|
| 72 |
+
&& chown -R appuser:appuser /home/appuser \
|
| 73 |
+
&& chmod 700 "$TMPDIR" \
|
| 74 |
+
&& chmod 1777 /tmp # belt & suspenders: ensure /tmp is world-writable with sticky bit
|
| 75 |
+
|
| 76 |
+
|
| 77 |
# Drop root
|
| 78 |
USER appuser
|
| 79 |
|