make site-headless builds the CLI without cgo (aego_nonative) and the static site with the wasm playground. deploy/ holds the image, the container nginx config (gzip_static with Vary), compose and deploy.sh run by the post-receive hook on mainserv. .gitignore ignores only the root site/ output; tools/gendocs/site was never committed because of it. Docs site: index and section summaries render code, bold and italic instead of raw markdown; search.json gets the plain text. Page summaries drop a leading list or quote marker. The nav toggle is three CSS bars centred in a 32px button. Playground: a loading overlay in the editor pane shows a spinner, a progress bar and the downloaded size while aego.wasm streams in, then 'Starting engine' until the runtime is ready; a failed start keeps the error on the overlay. docstool writes the wasm size and a version hash into index.html; play.js, play.css, wasm_exec.js and aego.wasm are referenced with ?v=<hash> so a deploy never mixes cached old files with new ones. Instruction budget: default 1M per callback (was 100k), playground 2M; the donut needs ~120k per frame. Playground: software 3D donut example, multi-line log entries render as monospace blocks, a fault is reported once instead of also as a "script stopped" log line. The compose project is named aego explicitly; the default name came from the deploy/ directory and collided with other stacks on the host.
15 lines
619 B
Docker
15 lines
619 B
Docker
FROM golang:1.27-alpine AS build
|
|
RUN apk add --no-cache make gzip
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
COPY tools/gendocs/go.mod tools/gendocs/go.sum tools/gendocs/
|
|
RUN go mod download && cd tools/gendocs && go mod download
|
|
COPY . .
|
|
RUN make site-headless
|
|
RUN find site -type f \( -name '*.js' -o -name '*.css' -o -name '*.html' -o -name '*.json' -o -name '*.svg' \) -exec gzip -9 -k -f {} \;
|
|
|
|
FROM nginx:1.27-alpine
|
|
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /src/site /usr/share/nginx/html
|
|
HEALTHCHECK --interval=10s --timeout=3s CMD wget -qO- http://127.0.0.1/healthz >/dev/null || exit 1
|