This will be a container that will make it easier to run and review terminalcraft programs.
How this is going to work
- A linux container
- All the languages that I expect Hack Clubbers to use to develop their TerminalCraft projects in
- Ruby, Python, C/C++, Rust, JavaScript/Node.js, Java, C# (dotnet)
- The container is going to take as argument
- full url to project it has to clone from PR or folder in the terminalcraft repository
- could even be just the branch name it has to checkout out to and commit hash/HEAD
- full url to project it has to clone from PR or folder in the terminalcraft repository
- The process
- Initialize the linux Docker container
- Clone the repository
- Changes directory into the project
- Binds to an exposed port on the host machine
- Returns a url one can visit to run the terminalcraft program
- *If possible, the readme of the terminalcraft program will be printed
- Exiting the container clears it's memory
- Containers should be cleaned up after a day of inactivity
- Docker
- Python3
- caddy-server
- Install the dependencies with
pip3 install -r requirements.txt --break-system-packages- Build the Docker image
docker build -t jos/palm .- Set environment variables
Replace
ROOT_DOMAINwith the root domain you want to use andAPP_PORT.
- Set A record
terminalcraft.josiasw.devthat points to the IP of your service - Set an A record that points to the IP of your server. e.g A |
*.terminalcraft.josiasw.dev192.168.2.111
ROOT_DOMAIN=terminalcraft.josiasw.dev
APP_PORT=8001
- Start the server using
python3 expose.py- Start caddy server in watch mode
caddy run --watchGET terminalcraft.josiasw.dev/projects/<project-name>
^ This will start a new Docker container and expose to the internet under <project-name>.terminalcraft.josiasw.dev (or whatever <project-name>.your-subdomain.tld)
Navigating to <project-name>.your-subdomain.tld will start a session and connect to that Docker container for your usage
Create a config.json in the root of the project folder with the following structure
{
"setup": "single command to setup the project and install dependencies",
"run": "command to run the project"
}