Skip to content

Commit c714c1a

Browse files
committed
Deployment
1 parent 1e8fb7b commit c714c1a

5 files changed

Lines changed: 77 additions & 0 deletions

File tree

.do/app.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: application-intent-model
2+
region: nyc
3+
4+
services:
5+
- name: web
6+
github:
7+
repo: juicejs/application-intent-language
8+
branch: master
9+
deploy_on_push: true
10+
dockerfile_path: Dockerfile
11+
http_port: 8080
12+
instance_count: 1
13+
instance_size_slug: basic-xxs
14+
routes:
15+
- path: /

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.idea
3+
.DS_Store
4+
**/.DS_Store
5+
_site

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM nginx:1.27-alpine
2+
3+
WORKDIR /app
4+
COPY . /app
5+
6+
# Build static output in image so runtime is simple and deterministic.
7+
RUN rm -rf /usr/share/nginx/html/* \
8+
&& mkdir -p /usr/share/nginx/html \
9+
&& cp -R /app/site/* /usr/share/nginx/html/ \
10+
&& cp /app/README.md /usr/share/nginx/html/README.md \
11+
&& cp /app/specification.md /usr/share/nginx/html/specification.md \
12+
&& cp -R /app/registry /usr/share/nginx/html/registry-files \
13+
&& find /usr/share/nginx/html -name '.DS_Store' -delete
14+
15+
COPY nginx.conf /etc/nginx/conf.d/default.conf
16+
17+
EXPOSE 8080
18+
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,22 @@ To enable it in GitHub:
5353
2. Set `Source` to `GitHub Actions`.
5454
3. Push to `main` or run the workflow manually.
5555

56+
## DigitalOcean App Platform
57+
58+
For custom domains and explicit `.intent` serving behavior, deploy with Docker + Nginx:
59+
60+
- `Dockerfile`
61+
- `nginx.conf`
62+
- `.do/app.yaml`
63+
64+
Nginx serves `*.intent` as `text/plain` and enables CORS for fetch clients.
65+
66+
After deploy, verify:
67+
68+
1. `/registry-files/index.json`
69+
2. `/registry-files/packages/weather/weather.intent`
70+
3. `/specification.md`
71+
5672
## Quick Example
5773

5874
```ail

nginx.conf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
server {
2+
listen 8080;
3+
listen [::]:8080;
4+
server_name _;
5+
6+
root /usr/share/nginx/html;
7+
index index.html;
8+
9+
# Serve AIM source files as plain text for AI fetch clients.
10+
location ~* \.intent$ {
11+
default_type text/plain;
12+
add_header Content-Type "text/plain; charset=utf-8" always;
13+
add_header Access-Control-Allow-Origin "*" always;
14+
try_files $uri =404;
15+
}
16+
17+
location / {
18+
add_header Access-Control-Allow-Origin "*" always;
19+
try_files $uri $uri/ =404;
20+
}
21+
22+
add_header X-Content-Type-Options "nosniff" always;
23+
}

0 commit comments

Comments
 (0)