Spaces:
Paused
Paused
Upload 3 files
Browse files- Dockerfile +13 -0
- README.md +8 -10
- entrypoint.sh +27 -0
Dockerfile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM devld/go-drive
|
| 2 |
+
|
| 3 |
+
# The go-drive application expects its data in /app/data.
|
| 4 |
+
# In Hugging Face Spaces, persistent storage is at /data.
|
| 5 |
+
# We use an entrypoint script to symlink /app/data to /data at runtime.
|
| 6 |
+
# The base image runs as root, so we have the necessary permissions.
|
| 7 |
+
USER root
|
| 8 |
+
|
| 9 |
+
COPY entrypoint.sh /entrypoint.sh
|
| 10 |
+
RUN chmod +x /entrypoint.sh
|
| 11 |
+
|
| 12 |
+
ENTRYPOINT ["/entrypoint.sh"]
|
| 13 |
+
CMD ["./go-drive"]
|
README.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
-
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo: red
|
| 6 |
-
sdk: docker
|
| 7 |
-
|
| 8 |
-
---
|
| 9 |
-
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: webdav
|
| 3 |
+
emoji: 🚀
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 8089
|
| 8 |
+
---
|
|
|
|
|
|
entrypoint.sh
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
# Use English for comments to avoid encoding issues.
|
| 3 |
+
set -e
|
| 4 |
+
|
| 5 |
+
# In Hugging Face Spaces, the /data directory is a persistent, writable volume.
|
| 6 |
+
# The go-drive application expects its data to be in /app/data.
|
| 7 |
+
# The base image creates /app/data as a normal directory.
|
| 8 |
+
# To persist data, we need to replace /app/data with a symbolic link
|
| 9 |
+
# to /data.
|
| 10 |
+
# This needs to be done at container startup, not during the image build,
|
| 11 |
+
# because /data is a runtime mount.
|
| 12 |
+
|
| 13 |
+
# If /app/data exists and is not a symbolic link, remove it.
|
| 14 |
+
# Then create the symbolic link.
|
| 15 |
+
if [ ! -L /app/data ]; then
|
| 16 |
+
echo "/app/data is not a symlink. Replacing with a symlink to /data"
|
| 17 |
+
rm -rf /app/data
|
| 18 |
+
ln -s /data /app/data
|
| 19 |
+
fi
|
| 20 |
+
|
| 21 |
+
# The application requires a 'temp' directory inside the data root.
|
| 22 |
+
# We ensure it exists.
|
| 23 |
+
mkdir -p /app/data/temp
|
| 24 |
+
|
| 25 |
+
echo "Starting go-drive..."
|
| 26 |
+
# Execute the command passed as arguments to this script (the Docker CMD).
|
| 27 |
+
exec "$@"
|