File tree Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 7373 push : true
7474 tags : ${{ steps.meta.outputs.tags }}
7575 labels : ${{ steps.meta.outputs.labels }}
76+ target : main
7677 deploy :
7778 runs-on : ubuntu-latest
7879 if : |
Original file line number Diff line number Diff line change 1- FROM caddy
1+ FROM caddy as web
22COPY . .
33RUN echo ":8000" > /etc/caddy/Caddyfile
44RUN echo "rewrite /repl /repl.html" >> /etc/caddy/Caddyfile
55RUN echo "rewrite /compilerepl /compilerepl.html" >> /etc/caddy/Caddyfile
66RUN echo "log" >> /etc/caddy/Caddyfile
77RUN echo "file_server" >> /etc/caddy/Caddyfile
8+
9+ FROM alpine:latest as build
10+ RUN printf -- '-m\n scrapscript\n ...' > .args
11+ RUN wget https://cosmo.zip/pub/cosmos/bin/assimilate
12+ RUN wget https://cosmo.zip/pub/cosmos/bin/ape-x86_64.elf
13+ RUN wget https://cosmo.zip/pub/cosmos/bin/python
14+ RUN wget https://cosmo.zip/pub/cosmos/bin/zip
15+ RUN chmod +x assimilate
16+ RUN chmod +x ape-x86_64.elf
17+ RUN chmod +x python
18+ RUN chmod +x zip
19+ RUN mkdir Lib
20+ COPY scrapscript.py Lib/
21+ COPY compiler.py Lib/
22+ COPY runtime.c Lib/
23+ COPY cli.c Lib/
24+ RUN ./ape-x86_64.elf ./python -m compileall -b Lib/scrapscript.py Lib/compiler.py
25+ RUN mv python scrapscript.com
26+ RUN ./ape-x86_64.elf ./zip -r scrapscript.com Lib .args
27+ RUN ./ape-x86_64.elf ./assimilate ./scrapscript.com
28+ RUN echo "Testing..."
29+ RUN ./scrapscript.com apply "1+2"
30+
31+ # Set up the container
32+ FROM scratch as main
33+ COPY --from=build scrapscript.com .
34+ ENTRYPOINT ["./scrapscript.com" ]
Original file line number Diff line number Diff line change @@ -40,6 +40,19 @@ or with [Cosmopolitan](https://justine.lol/cosmopolitan/index.html):
4040(if you have an exec format error and use Zsh, either upgrade Zsh or prefix
4141with ` sh ` )
4242
43+ or with Docker:
44+
45+ ``` bash
46+ # With a file (mount your local directory)
47+ docker run --mount type=bind,source=" $( pwd) " ,target=/mnt -i -t ghcr.io/tekknolagi/scrapscript:trunk eval /mnt/examples/0_home/factorial.scrap
48+
49+ # With a string literal
50+ docker run -i -t ghcr.io/tekknolagi/scrapscript:trunk apply " 1 + 2"
51+
52+ # With a REPL
53+ docker run -i -t ghcr.io/tekknolagi/scrapscript:trunk repl
54+ ```
55+
4356### The experimental compiler:
4457
4558#### Normal ELF
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ app = "scrapscript"
77primary_region = " ewr"
88
99[build ]
10+ build-target = " web"
1011
1112[http_service ]
1213 internal_port = 8000
You can’t perform that action at this time.
0 commit comments