Skip to content

Commit 7149775

Browse files
add magic container templates (#67)
* serve templates * update icons
1 parent 2d6d017 commit 7149775

40 files changed

Lines changed: 741 additions & 0 deletions
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Upload templates
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "templates/**"
8+
workflow_dispatch:
9+
10+
jobs:
11+
upload:
12+
name: Upload to Bunny Storage
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5
16+
- name: Upload templates
17+
env:
18+
BUNNYNET_STORAGE_ENDPOINT: ${{ vars.BUNNYNET_STORAGE_ENDPOINT }}
19+
BUNNYNET_STORAGE_ZONE: ${{ vars.BUNNYNET_STORAGE_ZONE }}
20+
BUNNYNET_STORAGE_PASSWORD: ${{ secrets.BUNNYNET_STORAGE_PASSWORD }}
21+
run: |
22+
content_type_for() {
23+
case "$1" in
24+
*.jsonc|*.json) echo "application/json" ;;
25+
*.svg) echo "image/svg+xml" ;;
26+
*.png) echo "image/png" ;;
27+
*.md) echo "text/markdown" ;;
28+
*) echo "application/octet-stream" ;;
29+
esac
30+
}
31+
32+
find templates -type f ! -name '.gitkeep' -print0 | while IFS= read -r -d '' file; do
33+
CHECKSUM=$(sha256sum "$file" | awk '{print toupper($1)}')
34+
CONTENT_TYPE=$(content_type_for "$file")
35+
echo "Uploading $file ($CONTENT_TYPE)"
36+
curl --fail --show-error --silent \
37+
-X PUT \
38+
-H "AccessKey: ${BUNNYNET_STORAGE_PASSWORD}" \
39+
-H "Content-Type: ${CONTENT_TYPE}" \
40+
-H "Checksum: ${CHECKSUM}" \
41+
--upload-file "$file" \
42+
"https://${BUNNYNET_STORAGE_ENDPOINT}/${BUNNYNET_STORAGE_ZONE}/${file}"
43+
done
44+
- name: Purge CDN cache
45+
env:
46+
BUNNYNET_API_KEY: ${{ secrets.BUNNYNET_API_KEY }}
47+
BUNNYNET_TEMPLATES_URL: ${{ vars.BUNNYNET_TEMPLATES_URL }}
48+
run: |
49+
ENCODED_URL=$(jq -rn --arg u "${BUNNYNET_TEMPLATES_URL}*" '$u|@uri')
50+
curl --fail --show-error --silent \
51+
-X POST \
52+
-H "AccessKey: ${BUNNYNET_API_KEY}" \
53+
"https://api.bunny.net/purge?url=${ENCODED_URL}&async=false"

templates/apps/astro.svg

Lines changed: 1 addition & 0 deletions
Loading

templates/apps/clickhouse.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "../../packages/app-config/generated/schema.json",
3+
"version": "2026-05-12",
4+
"app": {
5+
"name": "Django with Redis",
6+
"scaling": { "min": 1, "max": 1 },
7+
"regions": ["DE"],
8+
"containers": {
9+
"app": {
10+
"image": "jamie-at-bunny/mc-template-django-with-redis",
11+
"env": {
12+
"REDIS_URL": "redis://localhost:6379"
13+
},
14+
"endpoints": [
15+
{
16+
"type": "cdn",
17+
"ssl": false,
18+
"ports": [{ "public": 8000, "container": 8000 }]
19+
}
20+
]
21+
},
22+
"db": {
23+
"image": "redis:7-alpine",
24+
"volumes": [{ "name": "redis-data", "mount": "/data", "size": 5 }]
25+
}
26+
}
27+
}
28+
}
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "../../packages/app-config/generated/schema.json",
3+
"version": "2026-05-12",
4+
"app": {
5+
"name": "FastAPI KV with Redis",
6+
"scaling": { "min": 1, "max": 1 },
7+
"regions": ["DE"],
8+
"containers": {
9+
"app": {
10+
"image": "jamie-at-bunny/mc-template-fastapi-with-redis",
11+
"env": {
12+
"REDIS_URL": "redis://localhost:6379"
13+
},
14+
"endpoints": [
15+
{
16+
"type": "cdn",
17+
"ssl": false,
18+
"ports": [{ "public": 8080, "container": 8080 }]
19+
}
20+
]
21+
},
22+
"redis": {
23+
"image": "redis:latest",
24+
"volumes": [{ "name": "data", "mount": "/data", "size": 1 }]
25+
}
26+
}
27+
}
28+
}
Lines changed: 1 addition & 0 deletions
Loading

templates/apps/flask-0.jsonc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "../../packages/app-config/generated/schema.json",
3+
"version": "2026-05-12",
4+
"app": {
5+
"name": "Flask",
6+
"scaling": { "min": 1, "max": 1 },
7+
"regions": ["DE"],
8+
"containers": {
9+
"app": {
10+
"image": "jamie-at-bunny/mc-template-flask",
11+
"endpoints": [
12+
{
13+
"type": "cdn",
14+
"ssl": false,
15+
"ports": [{ "public": 8000, "container": 8000 }]
16+
}
17+
]
18+
}
19+
}
20+
}
21+
}

templates/apps/flask-0.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "../../packages/app-config/generated/schema.json",
3+
"version": "2026-05-12",
4+
"app": {
5+
"name": "Flask with Redis",
6+
"scaling": { "min": 1, "max": 1 },
7+
"regions": ["DE"],
8+
"containers": {
9+
"app": {
10+
"image": "jamie-at-bunny/mc-template-flask-with-redis",
11+
"env": {
12+
"REDIS_URL": "redis://localhost:6379"
13+
},
14+
"endpoints": [
15+
{
16+
"type": "cdn",
17+
"ssl": false,
18+
"ports": [{ "public": 8000, "container": 8000 }]
19+
}
20+
]
21+
},
22+
"db": {
23+
"image": "redis:7-alpine",
24+
"volumes": [{ "name": "redis-data", "mount": "/data", "size": 5 }]
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)