-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
25 lines (20 loc) · 787 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM denoland/deno:alpine
RUN apk update && apk add \
# for shell out
bash \
# want GNU grep
grep \
# for `env -S`
coreutils \
# for `cjpeg`:
libjpeg-turbo-utils \
# to convert sources to PPM to feed to cjpeg
imagemagick
WORKDIR /app
COPY . .
# like jekyll, convert `README.md` to `index.html`
RUN echo 'import showdown from "https://esm.archive.org/showdown"; Deno.writeTextFileSync("index.html", new showdown.Converter({ completeHTMLDocument: true, tables: true, metadata: true }).makeHtml(Deno.readTextFileSync("README.md")))' | deno run -A -
# cache JS files we'll use
RUN deno cache --allow-import ./index.js
# fire up minimal webserver that serves static files & handles arbitrary routes to JS
CMD ./index.js -p5000