Spaces:
Runtime error
Runtime error
Use API asset URL (.assets[0].url) instead of browser_download_url - this requires authentication properly
Browse files- Dockerfile +14 -10
Dockerfile
CHANGED
|
@@ -29,22 +29,26 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 29 |
# Install private GitHub confluence-ingestor wheel using BuildKit secret
|
| 30 |
# -----------------------------
|
| 31 |
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 32 |
-
echo "β
GITHUB_TOKEN is set
|
| 33 |
&& echo "π Fetching latest release..." \
|
| 34 |
&& curl -s -L -H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
|
| 35 |
"https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases/latest" \
|
| 36 |
| tee /tmp/release.json \
|
| 37 |
-
&& ASSET_URL=$(cat /tmp/release.json | jq -r '.assets[0].
|
| 38 |
-
&& if [ -z "$ASSET_URL" ]; then echo "β No
|
| 39 |
-
&& echo "π₯ Downloading
|
| 40 |
-
&& curl -s -L
|
|
|
|
|
|
|
|
|
|
| 41 |
"${ASSET_URL}" \
|
| 42 |
-
&& echo "
|
| 43 |
-
&&
|
|
|
|
|
|
|
| 44 |
&& rm -f /tmp/release.json /tmp/${WHEEL_NAME} \
|
| 45 |
-
&&
|
| 46 |
-
&&
|
| 47 |
-
|
| 48 |
|
| 49 |
EXPOSE 7860
|
| 50 |
|
|
|
|
| 29 |
# Install private GitHub confluence-ingestor wheel using BuildKit secret
|
| 30 |
# -----------------------------
|
| 31 |
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 32 |
+
echo "β
GITHUB_TOKEN is set" \
|
| 33 |
&& echo "π Fetching latest release..." \
|
| 34 |
&& curl -s -L -H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
|
| 35 |
"https://api.github.com/repos/${GITHUB_USERNAME}/${GITHUB_REPO_NAME}/releases/latest" \
|
| 36 |
| tee /tmp/release.json \
|
| 37 |
+
&& ASSET_URL=$(cat /tmp/release.json | jq -r '.assets[0].url // empty') \
|
| 38 |
+
&& if [ -z "$ASSET_URL" ]; then echo "β No asset URL"; exit 1; fi \
|
| 39 |
+
&& echo "π₯ Downloading from GitHub API asset URL: ${ASSET_URL}" \
|
| 40 |
+
&& curl -s -L \
|
| 41 |
+
-H "Authorization: token $(cat /run/secrets/GITHUB_TOKEN)" \
|
| 42 |
+
-H "Accept: application/octet-stream" \
|
| 43 |
+
-o /tmp/${WHEEL_NAME} \
|
| 44 |
"${ASSET_URL}" \
|
| 45 |
+
&& echo "π Downloaded file size: $(ls -lh /tmp/${WHEEL_NAME})" \
|
| 46 |
+
&& if [ ! -s /tmp/${WHEEL_NAME} ]; then echo "β Empty wheel file"; exit 1; fi \
|
| 47 |
+
&& echo "π§ Installing wheel..." \
|
| 48 |
+
&& pip install --no-cache-dir --verbose /tmp/${WHEEL_NAME} \
|
| 49 |
&& rm -f /tmp/release.json /tmp/${WHEEL_NAME} \
|
| 50 |
+
&& python -c "import confluence_ingestor; print('β confluence_ingestor import OK')" \
|
| 51 |
+
&& pip list | grep confluence || echo "β
Installation verified"
|
|
|
|
| 52 |
|
| 53 |
EXPOSE 7860
|
| 54 |
|