diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-10-31 23:50:51 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-10-31 23:50:51 +0100 |
commit | 3d1e81ef18c4b2138b834459262f262e44a3397d (patch) | |
tree | cf5114a1494f84bf21855edddc1112d40412c90c | |
parent | 25531d817bf6d6ef282855f44a64cd172d0bc2ec (diff) | |
download | reduced_system_layer-3d1e81ef18c4b2138b834459262f262e44a3397d.zip |
Add Dockerfile for wasm compilation
-rw-r--r-- | Dockerfile | 11 | ||||
-rw-r--r-- | index.htm | 7 | ||||
-rw-r--r-- | nginx.conf | 26 |
3 files changed, 44 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..04fb96a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM emscripten/emsdk as build +COPY reduced_system_layer.c /usr/reduced_system_layer.c +RUN emcc -o /usr/index.wasm /usr/reduced_system_layer.c + +FROM nginx:alpine +EXPOSE 80 +COPY --from=build /usr/index.wasm /srv/index.wasm +COPY index.htm /srv/index.htm +COPY nginx.conf /etc/nginx/nginx.conf +RUN ls -la /srv/ +ENTRYPOINT [ "nginx" ] diff --git a/index.htm b/index.htm new file mode 100644 index 0000000..7753a28 --- /dev/null +++ b/index.htm @@ -0,0 +1,7 @@ +<html> + <head> + </head> + <body> + Hello, Sailor! + </body> +</html> diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..83e6d1b --- /dev/null +++ b/nginx.conf @@ -0,0 +1,26 @@ +user nginx; +daemon off; +worker_processes 1; +pid /var/run/nginx.pid; +events { + worker_connections 1024; +} +http { + types { + text/html htm; + application/wasm wasm; + } + default_type application/octet-stream; + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; + sendfile on; + keepalive_timeout 65; + server { + listen 80; + listen [::]:80; + location / { + root /srv; + try_files $uri $uri/index.htm =404; + } + } +} |