image_get fix, build examples

frdel committed Jul 29, 2025 at 17:37 UTC 8dd641bf132b84fb70d669e5481c633639c6086f
2 files changed +19 -7
docker/run/build.txt
+15 -6
@@ -8,25 +8,34 @@ docker build -f DockerfileLocal -t agent-zero-local --build-arg CACHE_DATE=$(dat
8 # local development image based on local files without cache
9 docker build -f DockerfileLocal -t agent-zero-local --no-cache .
10
11 +
12 +# GIT BASED BUILDS
13 +# Run these commands from the /docker/run directory
14 +
15 # local image based on development branch instead of local files
12 -docker build -f ./docker/run/Dockerfile -t agent-zero-development --build-arg BRANCH=development --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) .
16 +docker build -t agent-zero-development --build-arg BRANCH=development --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) .
17
18 +# local image based on testing branch instead of local files
19 +docker build -t agent-zero-testing --build-arg BRANCH=testing --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) .
20 +
21 +# local image based on main branch instead of local files
22 +docker build -t agent-zero-main --build-arg BRANCH=main --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) .
23
24
16 -# dockerhub push:
17 -# Run these commands from the project root folder
25
26 +# DOCKERHUB PUSH
27 +# Run these commands from the /docker/run directory
28
29 docker login
30
31 # development:
23 -docker buildx build -f ./docker/run/Dockerfile -t agent0ai/agent-zero:development --platform linux/amd64,linux/arm64 --push --build-arg BRANCH=development --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) ./docker/run
32 +docker buildx build -t agent0ai/agent-zero:development --platform linux/amd64,linux/arm64 --push --build-arg BRANCH=development --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) .
33
34 # testing:
26 -docker buildx build -f ./docker/run/Dockerfile -t agent0ai/agent-zero:testing --platform linux/amd64,linux/arm64 --push --build-arg BRANCH=testing --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) ./docker/run
35 +docker buildx build -t agent0ai/agent-zero:testing --platform linux/amd64,linux/arm64 --push --build-arg BRANCH=testing --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) .
36
37 # main
29 -docker buildx build -f ./docker/run/Dockerfile -t agent0ai/agent-zero:vx.x.x -t agent0ai/agent-zero:latest --platform linux/amd64,linux/arm64 --push --build-arg BRANCH=main --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) ./docker/run
38 +docker buildx build -t agent0ai/agent-zero:vx.x.x -t agent0ai/agent-zero:latest --platform linux/amd64,linux/arm64 --push --build-arg BRANCH=main --build-arg CACHE_DATE=$(date +%Y-%m-%d:%H:%M:%S) .
39
40
41 # plain output
python/api/image_get.py
+4 -1
@@ -65,7 +65,10 @@ class ImageGet(ApiHandler):
65 else:
66 response = _send_fallback_icon("image")
67 else:
68 - response = send_file(path)
68 + if files.exists(path):
69 + response = send_file(path)
70 + else:
71 + response = _send_fallback_icon("image")
72
73 # Add cache headers for better device sync performance
74 response.headers["Cache-Control"] = "public, max-age=3600"