Intended as teaching instrument for a free Python course in Portuguese.
NOTE: Although my modifications are CC0, the project is hevily taken from the project container2wasm.
It has a large amount of dependencies all with their own licenses.
container2wasm project - https://github.com/ktock/container2wasm
Please check out the repo, it's wonderfully complex, deep, and amazing.
Author(s) have many examples and detailed documentation.
I'd like to thank all of the people and projects that made this possible.
I'd like to also thank https://github.com/oevermod for the help in configuring Apache as well as all the support and patience. <3
Project runs Alpine Linux with Python installed plus a few extras to modify it for teaching basic Python.
Everything here was done on Debian 12
Install the following dependencies if not installed yet:
- Install Docker from https://docs.docker.com/engine/install/
- Install c2w binaries from https://github.com/ktock/container2wasm/releases
I used v0.6.1, latest at time of this project - Download, Install, and Activate emsdk from https://emscripten.org/docs/getting_started/downloads.html
- Activate emsdk environment variables
source ./emsdk_env.sh - Install openssl
sudo apt-get install openssl - Install git
sudo apt-get install git
git clone https://github.com/vluz/minipy_wasm.git
cd minipy_wasm
Change directory to the root of the repository
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ./certs/server.key -out ./certs/server.crt
Answer all the questions as you see fit
The one important thing you'll need to fill out is the "Common Name"
You'll want to set to your server's IP address or domain name
Take note of the certificate password used
cd podman_compose
podman build -t minipy .
Building will take a long time, please wait for build to complete
Change directory to the root of the repository
c2w minipy ./htdocs/htdocs/out.wasm
Building will take a long time, please wait for build to complete
You can use my image from this link:
https://drive.google.com/file/d/1uFw8RxWYPgkN6TTGl2ZQmsun9UK25i53/view?usp=sharing
Change directory to the root of the repository
docker run -it -p 8080:443 \
-v "./htdocs/htdocs:/usr/local/apache2/htdocs/:ro" \
-v "./htdocs/xterm-pty.conf:/usr/local/apache2/conf/extra/xterm-pty.conf:ro" \
-v "./certs/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro" \
-v "./certs/server.crt:/usr/local/apache2/conf/server.crt:ro" \
-v "./certs/server.key:/usr/local/apache2/conf/server.key:ro" \
--entrypoint=/bin/sh \
httpd:latest \
-c 'httpd-foreground'
You will be prompted with the certificate password
Go to https://<your_ip>:8080
Accept the self-signed certificate
Wait for everything to load, will take some time
If it all worked you should see something like this:
Also works on Android

